-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tom/trends-old-tests
- Loading branch information
Showing
621 changed files
with
23,938 additions
and
8,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ | |
!share/GeoLite2-City.mmdb | ||
!hogvm/python | ||
!unit.json | ||
!plugin-transpiler/src | ||
!plugin-transpiler/*.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,4 +54,5 @@ gen/ | |
.antlr | ||
upgrade/ | ||
hogvm/typescript/dist | ||
|
||
.wokeignore | ||
plugin-transpiler/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
|
||
set -e | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
# Automatically restart without asking. | ||
# this gets around needrestart command halting for user input | ||
export RESTART_MODE=l | ||
export POSTHOG_APP_TAG="${POSTHOG_APP_TAG:-latest}" | ||
export SENTRY_DSN="${SENTRY_DSN:-'https://[email protected]/1'}" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import http.client | ||
import json | ||
from prometheus_client import CollectorRegistry, Gauge, multiprocess, generate_latest | ||
|
||
UNIT_CONNECTIONS_ACCEPTED_TOTAL = Gauge( | ||
"unit_connections_accepted_total", | ||
"", | ||
multiprocess_mode="livesum", | ||
) | ||
UNIT_CONNECTIONS_ACTIVE = Gauge( | ||
"unit_connections_active", | ||
"", | ||
multiprocess_mode="livesum", | ||
) | ||
UNIT_CONNECTIONS_CLOSED = Gauge( | ||
"unit_connections_closed", | ||
"", | ||
multiprocess_mode="livesum", | ||
) | ||
UNIT_CONNECTIONS_IDLE = Gauge( | ||
"unit_connections_idle", | ||
"", | ||
multiprocess_mode="livesum", | ||
) | ||
UNIT_CONNECTIONS_TOTAL = Gauge( | ||
"unit_requests_total", | ||
"", | ||
multiprocess_mode="livesum", | ||
) | ||
UNIT_PROCESSES_RUNNING_GAUGE = Gauge( | ||
"unit_application_processes_running", "", multiprocess_mode="livesum", labelnames=["application"] | ||
) | ||
UNIT_PROCESSES_STARTING_GAUGE = Gauge( | ||
"unit_application_processes_starting", "", multiprocess_mode="livesum", labelnames=["application"] | ||
) | ||
UNIT_PROCESSES_IDLE_GAUGE = Gauge( | ||
"unit_application_processes_idle", "", multiprocess_mode="livesum", labelnames=["application"] | ||
) | ||
UNIT_REQUESTS_ACTIVE_GAUGE = Gauge( | ||
"unit_application_requests_active", "", multiprocess_mode="livesum", labelnames=["application"] | ||
) | ||
|
||
|
||
def application(environ, start_response): | ||
connection = http.client.HTTPConnection("localhost:8081") | ||
connection.request("GET", "/status") | ||
response = connection.getresponse() | ||
|
||
statj = json.loads(response.read()) | ||
connection.close() | ||
|
||
UNIT_CONNECTIONS_ACCEPTED_TOTAL.set(statj["connections"]["accepted"]) | ||
UNIT_CONNECTIONS_ACTIVE.set(statj["connections"]["active"]) | ||
UNIT_CONNECTIONS_IDLE.set(statj["connections"]["idle"]) | ||
UNIT_CONNECTIONS_CLOSED.set(statj["connections"]["closed"]) | ||
UNIT_CONNECTIONS_TOTAL.set(statj["requests"]["total"]) | ||
|
||
for application in statj["applications"].keys(): | ||
UNIT_PROCESSES_RUNNING_GAUGE.labels(application=application).set( | ||
statj["applications"][application]["processes"]["running"] | ||
) | ||
UNIT_PROCESSES_STARTING_GAUGE.labels(application=application).set( | ||
statj["applications"][application]["processes"]["starting"] | ||
) | ||
UNIT_PROCESSES_IDLE_GAUGE.labels(application=application).set( | ||
statj["applications"][application]["processes"]["idle"] | ||
) | ||
UNIT_REQUESTS_ACTIVE_GAUGE.labels(application=application).set( | ||
statj["applications"][application]["requests"]["active"] | ||
) | ||
|
||
start_response("200 OK", [("Content-Type", "text/plain")]) | ||
# Create the prometheus multi-process metric registry here | ||
# This will aggregate metrics we send from the Django app | ||
# We prepend our unit metrics here. | ||
registry = CollectorRegistry() | ||
multiprocess.MultiProcessCollector(registry) | ||
yield generate_latest(registry) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
describe('Billing', () => { | ||
beforeEach(() => { | ||
cy.intercept('/api/billing-v2/', { fixture: 'api/billing-v2/billing-v2.json' }) | ||
|
||
cy.visit('/organization/billing') | ||
}) | ||
|
||
it('Show unsubscribe survey', () => { | ||
cy.intercept('/api/billing-v2/deactivate?products=product_analytics', { | ||
fixture: 'api/billing-v2/billing-v2-unsubscribed-product-analytics.json', | ||
}) | ||
cy.get('[data-attr=more-button]').first().click() | ||
cy.contains('.LemonButton', 'Unsubscribe').click() | ||
cy.get('.LemonModal__content h3').should( | ||
'contain', | ||
'Why are you unsubscribing from Product analytics + data stack?' | ||
) | ||
cy.contains('.LemonModal .LemonButton', 'Unsubscribe').click() | ||
|
||
cy.get('[data-attr=upgrade-card-product_analytics]').should('be.visible') | ||
}) | ||
|
||
it('Unsubscribe survey text area maintains unique state between product types', () => { | ||
cy.get('[data-attr=more-button]').first().click() | ||
cy.contains('.LemonButton', 'Unsubscribe').click() | ||
cy.get('.LemonModal__content h3').should( | ||
'contain', | ||
'Why are you unsubscribing from Product analytics + data stack?' | ||
) | ||
|
||
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Product analytics') | ||
cy.contains('.LemonModal .LemonButton', 'Cancel').click() | ||
|
||
cy.get('[data-attr=more-button]').eq(1).click() | ||
cy.contains('.LemonButton', 'Unsubscribe').click() | ||
cy.get('.LemonModal__content h3').should('contain', 'Why are you unsubscribing from Session replay?') | ||
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').type('Session replay') | ||
cy.contains('.LemonModal .LemonButton', 'Cancel').click() | ||
|
||
cy.get('[data-attr=more-button]').first().click() | ||
cy.contains('.LemonButton', 'Unsubscribe').click() | ||
cy.get('[data-attr=unsubscribe-reason-survey-textarea]').should('have.value', 'Product analytics') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.