Skip to content

Commit c544f3b

Browse files
committed
refactor: rename sdk to workload in SLO workflows and metrics
1 parent 60f284f commit c544f3b

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

.github/workflows/slo-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
- name: Publish YDB SLO Report
1919
uses: ydb-platform/ydb-slo-action/report@main
2020
with:
21-
token: ${{ secrets.GITHUB_TOKEN }}
22-
run_id: ${{ github.event.workflow_run.id }}
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
github_run_id: ${{ github.event.workflow_run.id }}

.github/workflows/slo.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ jobs:
3030

3131
strategy:
3232
matrix:
33-
sdk:
34-
- py-sync-table
35-
- py-sync-query
33+
workload:
34+
- sync-table
35+
- sync-query
3636

3737
concurrency:
38-
group: slo-${{ github.ref }}-${{ matrix.sdk }}
38+
group: slo-${{ github.ref }}-${{ matrix.workload }}
3939
cancel-in-progress: true
4040

4141
steps:
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }}
6161
github_token: ${{ secrets.GITHUB_TOKEN }}
62-
sdk_name: ${{ matrix.sdk }}
62+
workload_name: ${{ matrix.workload }}
6363
ydb_database_node_count: 5
6464

6565
- name: Prepare SLO Database
@@ -69,7 +69,7 @@ jobs:
6969
- name: Run SLO Tests
7070
env:
7171
REF: '${{ github.head_ref || github.ref }}'
72-
SDK_SERVICE: '${{ matrix.sdk }}'
72+
WORKLOAD: '${{ matrix.workload }}'
7373
run: |
7474
python ./tests/slo/src run grpc://localhost:2135 /Root/testdb \
7575
--prom-pgw localhost:9091 \
@@ -78,7 +78,12 @@ jobs:
7878
--read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \
7979
--write-rps ${{inputs.slo_workload_write_max_rps || 100}} \
8080
--read-timeout 1000 \
81-
--write-timeout 1000 || true
81+
--write-timeout 1000
82+
83+
- if: always()
84+
name: Cleanup SLO Database
85+
run: |
86+
python ./tests/slo/src cleanup grpc://localhost:2135 /Root/testdb
8287
8388
- if: always()
8489
name: Store ydb chaos testing logs
@@ -88,11 +93,6 @@ jobs:
8893
- if: always()
8994
uses: actions/upload-artifact@v4
9095
with:
91-
name: ${{ matrix.sdk }}-chaos-ydb.log
96+
name: ${{ matrix.workload }}-chaos-ydb.log
9297
path: ./chaos-ydb.log
9398
retention-days: 1
94-
95-
- if: always()
96-
name: Cleanup SLO Database
97-
run: |
98-
python ./tests/slo/src cleanup grpc://localhost:2135 /Root/testdb || true

tests/slo/src/metrics.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
OP_STATUS_SUCCESS, OP_STATUS_FAILURE = "success", "err"
1414

1515
REF = environ.get("REF", "main")
16-
SDK_SERVICE_NAME = environ.get("SDK_SERVICE", "py-sync-table")
16+
WORKLOAD = environ.get("WORKLOAD", "sync-query")
1717

1818

1919
class Metrics:
@@ -151,12 +151,14 @@ def stop(self, labels, start_time, attempts=1, error=None):
151151
def push(self):
152152
push_to_gateway(
153153
self._push_gtw,
154-
job=f"workload-{SDK_SERVICE_NAME}",
154+
job=f"workload-{WORKLOAD_NAME}",
155155
registry=self._registry,
156156
grouping_key={
157157
"ref": REF,
158-
"sdk": SDK_SERVICE_NAME,
158+
"sdk": "ydb-python-sdk",
159159
"sdk_version": version("ydb"),
160+
"workload": WORKLOAD_NAME,
161+
"workload_version": "0.0.0",
160162
},
161163
)
162164

tests/slo/src/runner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
run_write_jobs_query,
1515
run_metric_job,
1616
)
17-
from metrics import Metrics, SDK_SERVICE_NAME
17+
from metrics import Metrics, WORKLOAD
1818

1919
logger = logging.getLogger(__name__)
2020

@@ -91,20 +91,20 @@ def run_slo(args, driver, tb_name):
9191
logger.info("Max ID: %s", max_id)
9292

9393
metrics = Metrics(args.prom_pgw)
94-
if SDK_SERVICE_NAME == "py-sync-table":
94+
if WORKLOAD == "sync-table":
9595
futures = (
9696
*run_read_jobs(args, driver, tb_name, max_id, metrics),
9797
*run_write_jobs(args, driver, tb_name, max_id, metrics),
9898
run_metric_job(args, metrics),
9999
)
100-
elif SDK_SERVICE_NAME == "py-sync-query":
100+
elif WORKLOAD == "sync-query":
101101
futures = (
102102
*run_read_jobs_query(args, driver, tb_name, max_id, metrics),
103103
*run_write_jobs_query(args, driver, tb_name, max_id, metrics),
104104
run_metric_job(args, metrics),
105105
)
106106
else:
107-
raise ValueError(f"Unsupported service: {SDK_SERVICE_NAME}")
107+
raise ValueError(f"Unsupported service: {WORKLOAD}")
108108

109109
for future in futures:
110110
future.join()

0 commit comments

Comments
 (0)