diff --git a/slo-workload/DEV.md b/slo-workload/DEV.md new file mode 100644 index 00000000..69617bb3 --- /dev/null +++ b/slo-workload/DEV.md @@ -0,0 +1,52 @@ +# SLO development guide + +## Local testing + +### Start local environment + +In the [slo-tests](https://github.com/ydb-platform/slo-tests) project +in the _playground_ folder + + `docker compose up -d` + +### Check everything in the browser + +In the browser, open + +* [Grafana](http://localhost:3000/) + +* [YDB](http://localhost:8765/) (Check SLO dashboard) + +### Configure local console to run SLO tests + +In the [ydb-nodejs-sdk](https://github.com/ydb-platform/ydb-nodejs-sdk) project +in the _slo-workload_ folder + + `npm i` + + `set YDB_ANONYMOUS_CREDENTIALS=1` + + `set YDB_SSL_ROOT_CERTIFICATES_FILE=../../slo-tests/playground/data/ydb_certs/ca.pem` + +### Create the test database + + `npx ts-node src/index.ts create grpcs://localhost:2135 local` + +### Run the test - for 5 min + + `npx ts-node src/index.ts run grpcs://localhost:2135 local` + +### Clean the baseClean the base + + `npx ts-node src/index.ts cleanup grpcs://localhost:2135 local` + +### What to do in case of problems + +* Restart the environment + + `docker compose down` + + `docker compose up -d` + +* Repeat the tests several times. There are floating errors because the tests + are integration tests. So the picture may vary from one run to another diff --git a/slo-workload/src/metricsJob.ts b/slo-workload/src/metricsJob.ts index 9ed10a57..f956ac82 100644 --- a/slo-workload/src/metricsJob.ts +++ b/slo-workload/src/metricsJob.ts @@ -1,7 +1,7 @@ import Executor from './utils/Executor' export class MetricsJob { - private intervalId: NodeJS.Timer | undefined + private intervalId: NodeJS.Timeout | undefined private endTime: number private promise: Promise diff --git a/slo-workload/src/utils/RateLimiter.ts b/slo-workload/src/utils/RateLimiter.ts index c00a897f..c5a9cdb0 100644 --- a/slo-workload/src/utils/RateLimiter.ts +++ b/slo-workload/src/utils/RateLimiter.ts @@ -3,7 +3,7 @@ import NanoTimer from 'nanotimer' export default class RateLimiter { private delayMicroSec: number private count: number = 0 - private realRPSObserverId: NodeJS.Timer + private realRPSObserverId: NodeJS.Timeout private returnerTimer: NanoTimer private real: number = 0 private returner = () => {}