-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #675 from openedx/bmtcril/load_test
feat: Add support for data pipeline load testing
- Loading branch information
Showing
6 changed files
with
107 additions
and
41 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
tutoraspects/patches/openedx-dockerfile-post-python-requirements
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "platform-plugin-aspects==0.4.0" | ||
pip install "platform-plugin-aspects==v0.5.0" | ||
RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared \ | ||
pip install "edx-event-routing-backends==v8.1.1" | ||
pip install "edx-event-routing-backends==v8.3.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
60 changes: 60 additions & 0 deletions
60
...spects/templates/aspects/apps/aspects/migrations/alembic/versions/0034_load_test_table.py
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,60 @@ | ||
""" | ||
Create the load_test_stats table | ||
This table is always created, but it will only be populated if the load test | ||
management commands are run from the platform_plugin_aspects app. | ||
""" | ||
from alembic import op | ||
|
||
|
||
revision = "0034" | ||
down_revision = "0033" | ||
branch_labels = None | ||
depends_on = None | ||
on_cluster = " ON CLUSTER '{{CLICKHOUSE_CLUSTER_NAME}}' " if "{{CLICKHOUSE_CLUSTER_NAME}}" else "" | ||
engine = "ReplicatedMergeTree" if "{{CLICKHOUSE_CLUSTER_NAME}}" else "MergeTree" | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
f""" | ||
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.load_test_runs | ||
{on_cluster} | ||
( | ||
run_id String, | ||
timestamp DateTime default now(), | ||
event_type String, | ||
extra String | ||
) | ||
engine = {engine} PRIMARY KEY (run_id, timestamp) | ||
ORDER BY (run_id, timestamp) | ||
SETTINGS index_granularity = 8192; | ||
""" | ||
) | ||
|
||
op.execute( | ||
f""" | ||
CREATE TABLE IF NOT EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.load_test_stats | ||
{on_cluster} | ||
( | ||
run_id String, | ||
timestamp DateTime default now(), | ||
stats String | ||
) | ||
engine = {engine} PRIMARY KEY (run_id, timestamp) | ||
ORDER BY (run_id, timestamp) | ||
SETTINGS index_granularity = 8192; | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
"DROP TABLE IF EXISTS {{ ASPECTS_EVENT_SINK_DATABASE }}.load_test_stats" | ||
f"{on_cluster}" | ||
) | ||
|
||
op.execute( | ||
"DROP TABLE IF EXISTS {{ASPECTS_EVENT_SINK_DATABASE}}.load_test_runs" | ||
f"{on_cluster}" | ||
) |
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