Skip to content

Commit 4d90ae0

Browse files
committed
fix: after comments
1 parent 9c34beb commit 4d90ae0

File tree

20 files changed

+626
-453
lines changed

20 files changed

+626
-453
lines changed

.github/workflows/slo.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,12 @@ jobs:
3838

3939
strategy:
4040
matrix:
41-
sdk:
42-
- name: native
43-
label: native
4441
rust_version:
4542
- "RUST_VERSION_OLD"
4643
- "RUST_VERSION_NEW"
4744

4845
concurrency:
49-
group: slo-${{ github.ref }}-${{ matrix.sdk.name }}-${{ matrix.rust_version }}
46+
group: slo-${{ github.ref }}-native-${{ matrix.rust_version }}
5047
cancel-in-progress: true
5148

5249
steps:
@@ -75,31 +72,30 @@ jobs:
7572
REF=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
7673
REF_SAFE=${REF//\//__}
7774
echo "METRICS_REF=$REF_SAFE" >> $GITHUB_ENV
78-
echo "METRICS_LABEL=${{ matrix.sdk.label }}" >> $GITHUB_ENV
79-
echo "METRICS_JOB_NAME=${{ matrix.sdk.name }}" >> $GITHUB_ENV
75+
echo "METRICS_LABEL=native" >> $GITHUB_ENV
76+
echo "METRICS_JOB_NAME=native" >> $GITHUB_ENV
8077
8178
- name: Initialize YDB SLO
8279
uses: ydb-platform/ydb-slo-action/init@main
8380
with:
8481
github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }}
8582
github_token: ${{ secrets.GITHUB_TOKEN }}
86-
workload_name: ${{ matrix.sdk.name }}-${{ matrix.rust_version }}
83+
workload_name: native-${{ matrix.rust_version }}
8784
ydb_database_node_count: 5
8885

8986
- name: Prepare SLO Database
9087
run: |
91-
cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName create
88+
cargo run -- -t tableName grpc://localhost:2135 /Root/testdb create
9289
9390
- name: Run SLO Tests
9491
run: |
95-
cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName run \
92+
cargo run -- -t tableName --write-timeout 1 grpc://localhost:2135 /Root/testdb run \
9693
--prom-pgw localhost:9091 \
97-
--report-period 250 \
94+
--report-period 1 \
9895
--time ${{ inputs.slo_workload_duration_seconds || 600}} \
9996
--read-rps ${{ inputs.slo_workload_read_max_rps || 1000}} \
10097
--write-rps ${{ inputs.slo_workload_write_max_rps || 100}} \
101-
--read-timeout 1000 \
102-
--write-timeout 1000 || true
98+
--read-timeout 1 || true
10399
104100
- if: always()
105101
name: Store ydb chaos testing logs
@@ -109,14 +105,14 @@ jobs:
109105
- if: always()
110106
uses: actions/upload-artifact@v4
111107
with:
112-
name: ${{ matrix.sdk.name}}-${{ matrix.rust_version }}-chaos-ydb.log
108+
name: native-${{ matrix.rust_version }}-chaos-ydb.log
113109
path: ./chaos-ydb.log
114110
retention-days: 1
115111

116112
- if: always()
117113
name: Cleanup SLO Database
118114
run: |
119-
cargo run --example ${{ matrix.sdk.name }} grpc://localhost:2135 /Root/testdb tableName cleanup || true
115+
cargo run -- -t tableName grpc://localhost:2135 /Root/testdb cleanup || true
120116
validate-slo-metrics:
121117
name: Validate SLO metrics
122118
needs: ydb-slo-action-init
@@ -148,7 +144,7 @@ jobs:
148144
- name: Download metrics artifact
149145
uses: actions/download-artifact@v4
150146
with:
151-
name: ${{ matrix.sdk.name }}-${{ matrix.rust_version }}-metrics.json
147+
name: native-${{ matrix.rust_version }}-metrics.json
152148
path: ./artifacts
153149

154150
- name: Make script executable
@@ -157,4 +153,4 @@ jobs:
157153
- name: Validate SLO thresholds
158154
run: |
159155
.github/scripts/check-metrics.sh \
160-
./artifacts/${{ matrix.sdk.name }}-${{ matrix.rust_version }}-metrics.json
156+
./artifacts/native-${{ matrix.rust_version }}-metrics.json

Cargo.lock

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ members = [
55
"ydb-grpc",
66
# "ydb-grpc-helpers",
77
"ydb-example-urlshortener",
8-
"ydb-slo-tests",
8+
"ydb-slo-tests/lib",
9+
"ydb-slo-tests/native",
910
]

ydb-slo-tests/README.md

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,72 +15,82 @@ It has 3 commands:
1515

1616
create:
1717

18-
`cargo run --example native grpc://localhost:2136 /local tableName create --min-partitions-count 6 --max-partitions-count 1000 --partition-size 1 -c 1000 --write-timeout 10000`
18+
`cargo run -- -t testingTable --write-timeout 10 --db-init-timeout 3 grpc://localhost:2136 /local create --min-partitions-count 6 --max-partitions-count 1000 --partition-size 1 -c 1000`
1919

2020
cleanup:
2121

22-
`cargo run --example native grpc://localhost:2136 /local tableName cleanup`
22+
`cargo run -- -t testingTable --write-timeout 10 --db-init-timeout 3 grpc://localhost:2136 /local cleanup`
2323

2424
run:
2525

26-
`cargo run --example native grpc://localhost:2136 /local tableName run -c 1000 --read-rps 1000 --read-timeout 10000 --write-rps 100 --write-timeout 10000 --time 600 --prom-pgw localhost:9091 --report-period 250`
26+
`cargo run -- -t testingTable --write-timeout 10 --db-init-timeout 3 grpc://localhost:2136 /local run -c 1000 --read-rps 1000 --read-timeout 10 --write-rps 100 --prom-pgw localhost:9091 --time 600 --report-period 1 --shutdown-time 30`
2727

28-
## Arguments for commands:
28+
## Arguments and options for commands:
2929

3030
### create
3131

32-
`cargo run --example <example_name> <ENDPOINT> <DB> <TABLE_NAME> create [OPTIONS]`
32+
`cargo run [COMMON_OPTIONS] <ENDPOINT> <DB> create [OPTIONS]`
3333

3434
```
3535
Arguments:
3636
ENDPOINT YDB endpoint to connect to
3737
DB YDB database to connect to
38-
TABLE_NAME table name to create
38+
39+
Common options:
40+
-t --table-name <string> table name to create [default: testingTable]
41+
--write-timeout <u64> write timeout in seconds [default: 10]
42+
--db-init-timeout <u64> YDB database initialization timeout in seconds [default: 3]
3943
4044
Options:
41-
--min-partitions-count <u64> minimum amount of partitions in table
42-
--max-partitions-count <u64> maximum amount of partitions in table
43-
--partition-size <u64> partition size in mb
45+
-c --initial-data-count <u64> amount of initially created rows [default: 1000]
4446
45-
-c --initial-data-count <u64> amount of initially created rows
47+
--min-partitions-count <u64> minimum amount of partitions in table [default: 6]
4648
47-
--write-timeout <u64> write timeout milliseconds
49+
--max-partitions-count <u64> maximum amount of partitions in table [default: 1000]
50+
--partition-size <u64> partition size in mb [default: 1]
4851
```
4952

5053
### cleanup
5154

52-
`cargo run --example <example_name> <ENDPOINT> <DB> <TABLE_NAME> cleanup`
55+
`cargo run [COMMON_OPTIONS] <ENDPOINT> <DB> cleanup`
5356

5457
```
5558
Arguments:
5659
ENDPOINT YDB endpoint to connect to
5760
DB YDB database to connect to
58-
TABLE_NAME table name to cleanup
61+
62+
Common options:
63+
-t --table-name <string> table name to create [default: testingTable]
64+
--write-timeout <u64> write timeout in seconds [default: 10]
65+
--db-init-timeout <u64> YDB database initialization timeout in seconds [default: 3]
5966
```
6067

6168
### run
6269

63-
`cargo run --example <example_name> <ENDPOINT> <DB> <TABLE_NAME> run`
70+
`cargo run [COMMON_OPTIONS] <ENDPOINT> <DB> run [OPTIONS]`
6471

6572
```
6673
Arguments:
6774
ENDPOINT YDB endpoint to connect to
6875
DB YDB database to connect to
69-
TABLE_NAME table name to use
76+
77+
Common options:
78+
-t --table-name <string> table name to create [default: testingTable]
79+
--write-timeout <u64> write timeout in seconds [default: 10]
80+
--db-init-timeout <u64> YDB database initialization timeout in seconds [default: 3]
7081
71-
Options:
72-
-c --initial-data-count <u64> amount of initially created rows
82+
Options:
83+
-c --initial-data-count <u64> amount of initially created rows [default: 1000]
7384
74-
--read-rps <u32> read RPS
75-
--read-timeout <u64> read timeout milliseconds
76-
77-
--write-rps <u32> write RPS
78-
--write-timeout <u64> write timeout milliseconds
79-
80-
--time <u64> run time in seconds
85+
--read-rps <u32> read RPS [default: 1000]
86+
--write-rps <u32> write RPS [default: 100]
87+
88+
--prom-pgw <string> prometheus push gateway [default: ]
8189
82-
--prom-pgw <string> prometheus push gateway
83-
--report-period <u64> prometheus push period in milliseconds
90+
--read-timeout <u64> read timeout in seconds [default: 10]
91+
--time <u64> write timeout in seconds [default: 600]
92+
--report-period <u64> prometheus push period in seconds [default: 1]
93+
--shutdown-time <u64> time to wait before force kill workers in seconds [default: 30]
8494
```
8595

8696
## What's inside

ydb-slo-tests/examples/native/db.rs

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)