Skip to content

Commit e15c042

Browse files
[Service Bus] Perf tests with the framework (Azure#12993)
### New perf folder - The new "perf" folder uses the perf framework. - With the perf framework, only the send test can be written. - This PR adds the send test for track 1 and track 2. - This would be useful in comparing track 1 and track 2, as well as for the cross-language comparisons. - The track-2 tests depend on the current code on master and would require updates if the source code changes. #### To execute the track 2 tests 1. Build the service-bus package `rush build -t service-bus`. 2. Navigate to `service-bus` folder `cd sdk\servicebus\service-bus\`. 3. Create a service-bus namespace and populate the .env file at `servicebus\service-bus` folder with `SERVICEBUS_CONNECTION_STRING` variables. 4. Run the tests as follows - batch send - `npm run perf-test:node -- BatchSendTest --warmup 2 --duration 7 --parallel 2` #### To execture the track 1 tests 1. Navigate to `test-utils\perfstress` folder `cd sdk\test-utils\perfstress\` 2. Build the package `rush update && rush build -t test-utils-perfstress` 3. Pack the perf package `rushx pack` 4. Navigate to `service-bus\perf\track-1` folder `cd sdk\servicebus\service-bus\perf\track-1`. 5. Install the perf package `npm i ..\..\..\..\..\test-utils\perfstress\azure-test-utils-perfstress-1.0.0.tgz` 6. Run `npm install` to get `service-bus V1`. 7. Create a service-bus namespace and a queue with default options. Populate the .env file at `servicebus\service-bus` folder with `SERVICEBUS_CONNECTION_STRING` and `QUEUE_NAME` variables. 8. Run the tests as follows - batch send - `npm run perf-test:node -- BatchSendTest --warmup 2 --duration 7 --parallel 2` ### Existing perf tests - There is an existing "perf" folder with the tests for send and receive for `azure-sb`, `rhea-promise`, `service-bus-v1`, and `service-bus-v7` libraries. - These tests show the memory consumption too in the report. They do not use the perf framework. (And the perf framework isn't yet capable of handling the receive scenarios.) - Retaining the existing tests for the above reasons. - This PR renames the "perf" folder(with existing tests) to "perf-js-libs".
1 parent 230fd72 commit e15c042

File tree

27 files changed

+225
-3
lines changed

27 files changed

+225
-3
lines changed

eng/.docsettings.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ omitted_paths:
1717
- sdk/search/*/test/README.md
1818
- sdk/servicebus/*/test/README.md
1919
- sdk/servicebus/README.md
20-
- sdk/servicebus/service-bus/test/perf/service-bus-*
20+
- sdk/servicebus/service-bus/test/perf-js-libs/service-bus-*
21+
- sdk/servicebus/service-bus/test/perf/**
2122
- sdk/servicebus/service-bus/test/stress/*
2223
- sdk/schemaregistry/README.md
2324
- sdk/storage/*/test/README.md

sdk/servicebus/service-bus/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"lint:fix": "eslint package.json api-extractor.json src test --ext .ts --fix --fix-type [problem,suggestion]",
6868
"lint": "eslint package.json api-extractor.json src test --ext .ts -f html -o service-bus-lintReport.html || exit 0",
6969
"pack": "npm pack 2>&1",
70+
"perf-test:node": "cross-env TS_NODE_COMPILER_OPTIONS=\"{\\\"module\\\": \\\"commonjs\\\"}\" ts-node test/perf/track-2/index.spec.ts",
7071
"prebuild": "npm run clean",
7172
"test:browser": "npm run clean && npm run build:test:browser && npm run integration-test:browser",
7273
"test:node": "npm run clean && npm run build:test:node && npm run integration-test:node",
@@ -117,6 +118,7 @@
117118
"@azure/dev-tool": "^1.0.0",
118119
"@azure/eslint-plugin-azure-sdk": "^3.0.0",
119120
"@azure/identity": "^1.1.0",
121+
"@azure/test-utils-perfstress": "^1.0.0",
120122
"@microsoft/api-extractor": "7.7.11",
121123
"@rollup/plugin-commonjs": "11.0.2",
122124
"@rollup/plugin-inject": "^4.0.0",

sdk/servicebus/service-bus/rollup.base.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export function nodeConfig({ test = false, production = false } = {}) {
6767

6868
if (test) {
6969
// entry point is every test file
70-
baseConfig.input = "dist-esm/test/**/*.spec.js";
70+
baseConfig.input = [
71+
"dist-esm/service-bus/test/internal/*.spec.js",
72+
"dist-esm/service-bus/test/node/*.spec.js",
73+
"dist-esm/service-bus/test/*.spec.js"
74+
];
7175
baseConfig.plugins.unshift(multiEntry({ exports: false }));
7276

7377
// different output file

sdk/servicebus/service-bus/test/perf/azure-sb-package/receive.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/azure-sb-package/receive.ts

File renamed without changes.

sdk/servicebus/service-bus/test/perf/azure-sb-package/send.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/azure-sb-package/send.ts

File renamed without changes.

sdk/servicebus/service-bus/test/perf/rhea-promise/receive.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/rhea-promise/receive.ts

File renamed without changes.

sdk/servicebus/service-bus/test/perf/rhea-promise/send.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/rhea-promise/send.ts

File renamed without changes.

sdk/servicebus/service-bus/test/perf/service-bus-v1/package.json renamed to sdk/servicebus/service-bus/test/perf-js-libs/service-bus-v1/package.json

File renamed without changes.

sdk/servicebus/service-bus/test/perf/service-bus-v1/receive.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/service-bus-v1/receive.ts

File renamed without changes.

sdk/servicebus/service-bus/test/perf/service-bus-v1/receiveBatch.ts renamed to sdk/servicebus/service-bus/test/perf-js-libs/service-bus-v1/receiveBatch.ts

File renamed without changes.

0 commit comments

Comments
 (0)