From a97c7b80cf287304325a6a11580308b2f4fbff44 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Tue, 19 Oct 2021 16:50:23 -0700 Subject: [PATCH 1/8] [Perf Framework] rename PerfStress to Perf (#18033) --- common/config/rush/pnpm-lock.yaml | 10 +-- common/tools/perf-tests-track-1-setup.js | 12 ++-- dataplane.code-workspace | 4 +- eng/tools/rush-runner.js | 2 +- rush.json | 6 +- .../perf-tests/app-configuration/package.json | 2 +- .../test/appConfigBase.spec.ts | 4 +- .../app-configuration/test/index.spec.ts | 8 +-- .../test/listSettings.spec.ts | 4 +- .../container-registry/package.json | 2 +- .../container-registry/test/client.spec.ts | 4 +- .../container-registry/test/index.spec.ts | 10 +-- .../test/listArtifacts.spec.ts | 4 +- .../test/listRepositories.spec.ts | 4 +- .../core-rest-pipeline/package.json | 2 +- .../wwwChallenge.spec.ts | 4 +- .../core-rest-pipeline/test/index.spec.ts | 10 +-- .../perf-tests/eventgrid/package.json | 2 +- .../perf-tests/eventgrid/test/index.spec.ts | 8 +-- .../eventgrid/test/sendCloudEvents.spec.ts | 10 +-- sdk/eventhub/event-hubs/package.json | 2 +- .../perf-tests/event-hubs-track-1/README.md | 2 +- .../event-hubs-track-1/package.json | 2 +- .../event-hubs-track-1/test/index.spec.ts | 8 +-- .../event-hubs-track-1/test/receive.spec.ts | 2 +- .../event-hubs-track-1/test/send.spec.ts | 10 +-- sdk/eventhub/perf-tests/event-hubs/README.md | 2 +- .../perf-tests/event-hubs/package.json | 2 +- .../perf-tests/event-hubs/test/index.spec.ts | 8 +-- .../event-hubs/test/receive.spec.ts | 2 +- .../perf-tests/event-hubs/test/send.spec.ts | 10 +-- .../ai-form-recognizer/package.json | 2 +- .../ai-form-recognizer/test/custom.spec.ts | 10 +-- .../ai-form-recognizer/test/index.spec.ts | 8 +-- sdk/identity/perf-tests/identity/package.json | 2 +- .../persistence.spec.ts | 4 +- .../perf-tests/identity/test/index.spec.ts | 10 +-- .../keyvault-certificates/package.json | 2 +- .../test/getCertificate.spec.ts | 4 +- .../keyvault-certificates/test/index.spec.ts | 8 +-- .../keyvault-certificates/test/utils.ts | 2 +- .../perf-tests/keyvault-keys/package.json | 2 +- .../test/cryptography/cryptography.spec.ts | 6 +- .../keyvault-keys/test/index.spec.ts | 10 +-- .../keyvault-keys/test/keys/get.spec.ts | 6 +- .../perf-tests/keyvault-keys/test/utils.ts | 2 +- .../perf-tests/keyvault-secrets/package.json | 2 +- .../keyvault-secrets/test/index.spec.ts | 10 +-- .../keyvault-secrets/test/listSecrets.spec.ts | 4 +- .../keyvault-secrets/test/secretTest.ts | 4 +- .../perf-tests/keyvault-secrets/test/utils.ts | 2 +- .../ai-metrics-advisor/package.json | 2 +- .../ai-metrics-advisor/test/index.spec.ts | 10 +-- .../test/listAnomalies.spec.ts | 4 +- .../test/listIncidents.spec.ts | 4 +- .../test/metricsAdvisor.spec.ts | 4 +- .../test/rootCauses.spec.ts | 4 +- .../perf-tests/monitor-query/package.json | 2 +- .../monitor-query/test/index.spec.ts | 10 +-- .../monitor-query/test/logQuery.spec.ts | 4 +- .../monitor-query/test/logQueryBatch.spec.ts | 4 +- .../monitor-query/test/metricQuery.spec.ts | 4 +- .../test/monitorQueryLog.spec.ts | 4 +- .../test/monitorQueryMetrics.spec.ts | 4 +- .../perf-tests/search-documents/package.json | 2 +- .../test/autoCompleteTest.spec.ts | 4 +- .../test/core/searchDocumentsBase.spec.ts | 4 +- .../search-documents/test/index.spec.ts | 10 +-- .../test/indexDocumentsTest.spec.ts | 4 +- .../test/searchDocumentsTest.spec.ts | 4 +- .../search-documents/test/suggestTest.spec.ts | 4 +- .../perf-tests/service-bus-track-1/README.md | 2 +- .../service-bus-track-1/package.json | 2 +- .../service-bus-track-1/test/index.spec.ts | 8 +-- .../service-bus-track-1/test/sbBase.spec.ts | 4 +- .../test/sendBatch.spec.ts | 4 +- .../perf-tests/service-bus/README.md | 2 +- .../perf-tests/service-bus/package.json | 2 +- .../perf-tests/service-bus/test/index.spec.ts | 8 +-- .../service-bus/test/sbBase.spec.ts | 4 +- .../service-bus/test/sendBatch.spec.ts | 4 +- sdk/servicebus/service-bus/package.json | 2 +- .../storage-blob-track-1/package.json | 2 +- .../test/download.spec.ts | 4 +- .../storage-blob-track-1/test/index.spec.ts | 10 +-- .../test/listBlobs.spec.ts | 4 +- .../test/storageTest.spec.ts | 4 +- .../storage-blob-track-1/test/upload.spec.ts | 4 +- .../perf-tests/storage-blob/package.json | 2 +- .../storage-blob/test/core-http.spec.ts | 2 +- .../test/core-rest-pipeline.spec.ts | 2 +- .../storage-blob/test/dowloadWithSAS.spec.ts | 4 +- .../storage-blob/test/download.spec.ts | 4 +- .../storage-blob/test/index.spec.ts | 10 +-- .../storage-blob/test/listBlobs.spec.ts | 4 +- .../storage-blob/test/node-fetch.spec.ts | 2 +- .../storage-blob/test/storageTest.spec.ts | 4 +- .../storage-blob/test/upload.spec.ts | 4 +- .../storage-file-datalake/package.json | 2 +- .../storage-file-datalake/test/append.spec.ts | 4 +- .../storage-file-datalake/test/index.spec.ts | 10 +-- .../storage-file-datalake/test/read.spec.ts | 4 +- .../test/storageTest.spec.ts | 4 +- .../storage-file-datalake/test/upload.spec.ts | 4 +- .../storage-file-share-track-1/package.json | 2 +- .../test/download.spec.ts | 4 +- .../test/index.spec.ts | 10 +-- .../test/storageTest.ts | 4 +- .../test/upload.spec.ts | 4 +- .../storage-file-share/package.json | 2 +- .../storage-file-share/test/download.spec.ts | 4 +- .../test/downloadToFile.spec.ts | 4 +- .../storage-file-share/test/index.spec.ts | 10 +-- .../test/storageTest.spec.ts | 4 +- .../storage-file-share/test/upload.spec.ts | 4 +- .../test/uploadFromFile.spec.ts | 4 +- sdk/storage/storage-blob/package.json | 2 +- sdk/storage/storage-blob/tsconfig.json | 2 +- .../storage-file-datalake/package.json | 2 +- sdk/storage/storage-file-share/package.json | 2 +- .../perf-tests/data-tables/package.json | 2 +- .../test/createComplexEntity.spec.ts | 4 +- .../test/createComplexEntityBatchTest.spec.ts | 4 +- .../test/createSimpleEntity.spec.ts | 4 +- .../test/createSimpleEntityBatchTest.spec.ts | 4 +- .../perf-tests/data-tables/test/index.spec.ts | 10 +-- .../test/listComplexEntities.spec.ts | 4 +- .../test/listSimpleEntities.spec.ts | 4 +- .../data-tables/test/tables.spec.ts | 4 +- .../{perfstress => perf}/.dockerignore | 0 .../{perfstress => perf}/CHANGELOG.md | 6 +- .../{perfstress => perf}/Dockerfile | 0 .../{perfstress => perf}/GettingStarted.md | 28 ++++----- sdk/test-utils/{perfstress => perf}/LICENSE | 0 sdk/test-utils/{perfstress => perf}/README.md | 20 +++--- sdk/test-utils/perf/build.ps1 | 3 + .../{perfstress => perf}/karma.conf.js | 0 .../{perfstress => perf}/package.json | 6 +- sdk/test-utils/perf/run.ps1 | 3 + .../{perfstress => perf}/runAllTests.sh | 2 +- .../{perfstress => perf}/src/index.ts | 0 .../{perfstress => perf}/src/options.ts | 28 ++++----- .../{perfstress => perf}/src/parallel.ts | 4 +- .../{perfstress => perf}/src/policy.ts | 2 +- .../{perfstress => perf}/src/program.ts | 62 +++++++++---------- .../src/testProxyHttpClient.ts | 0 .../{perfstress => perf}/src/tests.ts | 48 +++++++------- .../{perfstress => perf}/src/utils.ts | 0 .../{perfstress => perf}/test/delay.spec.ts | 6 +- .../test/exception.spec.ts | 6 +- .../{perfstress => perf}/test/index.spec.ts | 14 ++--- .../test/nodeFetch.spec.ts | 6 +- sdk/test-utils/perf/test/noop.spec.ts | 13 ++++ .../{perfstress => perf}/test/options.spec.ts | 8 +-- .../test/perfPolicy.spec.ts} | 12 ++-- .../test/serviceClientGet.spec.ts | 6 +- .../test/setupCleanup.spec.ts | 8 +-- .../{perfstress => perf}/test/sleep.spec.ts | 4 +- .../{perfstress => perf}/tsconfig.json | 0 sdk/test-utils/perfstress/build.ps1 | 3 - sdk/test-utils/perfstress/run.ps1 | 3 - sdk/test-utils/perfstress/test/noop.spec.ts | 13 ---- .../perf-tests/text-analytics/package.json | 2 +- .../test/detectLanguage.spec.ts | 10 +-- .../text-analytics/test/index.spec.ts | 8 +-- 165 files changed, 464 insertions(+), 464 deletions(-) rename sdk/test-utils/{perfstress => perf}/.dockerignore (100%) rename sdk/test-utils/{perfstress => perf}/CHANGELOG.md (84%) rename sdk/test-utils/{perfstress => perf}/Dockerfile (100%) rename sdk/test-utils/{perfstress => perf}/GettingStarted.md (93%) rename sdk/test-utils/{perfstress => perf}/LICENSE (100%) rename sdk/test-utils/{perfstress => perf}/README.md (64%) create mode 100644 sdk/test-utils/perf/build.ps1 rename sdk/test-utils/{perfstress => perf}/karma.conf.js (100%) rename sdk/test-utils/{perfstress => perf}/package.json (94%) create mode 100644 sdk/test-utils/perf/run.ps1 rename sdk/test-utils/{perfstress => perf}/runAllTests.sh (84%) rename sdk/test-utils/{perfstress => perf}/src/index.ts (100%) rename sdk/test-utils/{perfstress => perf}/src/options.ts (85%) rename sdk/test-utils/{perfstress => perf}/src/parallel.ts (94%) rename sdk/test-utils/{perfstress => perf}/src/policy.ts (96%) rename sdk/test-utils/{perfstress => perf}/src/program.ts (89%) rename sdk/test-utils/{perfstress => perf}/src/testProxyHttpClient.ts (100%) rename sdk/test-utils/{perfstress => perf}/src/tests.ts (75%) rename sdk/test-utils/{perfstress => perf}/src/utils.ts (100%) rename sdk/test-utils/{perfstress => perf}/test/delay.spec.ts (89%) rename sdk/test-utils/{perfstress => perf}/test/exception.spec.ts (74%) rename sdk/test-utils/{perfstress => perf}/test/index.spec.ts (66%) rename sdk/test-utils/{perfstress => perf}/test/nodeFetch.spec.ts (77%) create mode 100644 sdk/test-utils/perf/test/noop.spec.ts rename sdk/test-utils/{perfstress => perf}/test/options.spec.ts (90%) rename sdk/test-utils/{perfstress/test/perfStressPolicy.spec.ts => perf/test/perfPolicy.spec.ts} (81%) rename sdk/test-utils/{perfstress => perf}/test/serviceClientGet.spec.ts (88%) rename sdk/test-utils/{perfstress => perf}/test/setupCleanup.spec.ts (84%) rename sdk/test-utils/{perfstress => perf}/test/sleep.spec.ts (90%) rename sdk/test-utils/{perfstress => perf}/tsconfig.json (100%) delete mode 100644 sdk/test-utils/perfstress/build.ps1 delete mode 100644 sdk/test-utils/perfstress/run.ps1 delete mode 100644 sdk/test-utils/perfstress/test/noop.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 34a8029b1c84..88f76545e5da 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -128,7 +128,7 @@ specifiers: '@rush-temp/test-recorder': file:./projects/test-recorder.tgz '@rush-temp/test-recorder-new': file:./projects/test-recorder-new.tgz '@rush-temp/test-utils': file:./projects/test-utils.tgz - '@rush-temp/test-utils-perfstress': file:./projects/test-utils-perfstress.tgz + '@rush-temp/test-utils-perf': file:./projects/test-utils-perf.tgz '@rush-temp/testing-recorder-new': file:./projects/testing-recorder-new.tgz '@rush-temp/video-analyzer-edge': file:./projects/video-analyzer-edge.tgz '@rush-temp/web-pubsub': file:./projects/web-pubsub.tgz @@ -262,7 +262,7 @@ dependencies: '@rush-temp/test-recorder': file:projects/test-recorder.tgz '@rush-temp/test-recorder-new': file:projects/test-recorder-new.tgz '@rush-temp/test-utils': file:projects/test-utils.tgz - '@rush-temp/test-utils-perfstress': file:projects/test-utils-perfstress.tgz + '@rush-temp/test-utils-perf': file:projects/test-utils-perf.tgz '@rush-temp/testing-recorder-new': file:projects/testing-recorder-new.tgz '@rush-temp/video-analyzer-edge': file:projects/video-analyzer-edge.tgz '@rush-temp/web-pubsub': file:projects/web-pubsub.tgz @@ -13179,9 +13179,9 @@ packages: - utf-8-validate dev: false - file:projects/test-utils-perfstress.tgz: - resolution: {integrity: sha512-RYaN04zHouUgjzQ9x25yRE/XBAnAIADGNe1Th5m6lgEXeohWPorl+nFH3cqS5LdppUoTXnif5cL5Im0gwZ1YUA==, tarball: file:projects/test-utils-perfstress.tgz} - name: '@rush-temp/test-utils-perfstress' + file:projects/test-utils-perf.tgz: + resolution: {integrity: sha512-RYaN04zHouUgjzQ9x25yRE/XBAnAIADGNe1Th5m6lgEXeohWPorl+nFH3cqS5LdppUoTXnif5cL5Im0gwZ1YUA==, tarball: file:projects/test-utils-perf.tgz} + name: '@rush-temp/test-utils-perf' version: 0.0.0 dependencies: '@types/minimist': 1.2.2 diff --git a/common/tools/perf-tests-track-1-setup.js b/common/tools/perf-tests-track-1-setup.js index 25d3348612e2..3c8b95aa5f18 100644 --- a/common/tools/perf-tests-track-1-setup.js +++ b/common/tools/perf-tests-track-1-setup.js @@ -5,7 +5,7 @@ * Track 1 perf tests are not maintained through rush in this repository. * * This helper script is meant to be used to "build" and "install" - * the `@azure/test-utils-perfstress` package in the track-1 perf-test projects + * the `@azure/test-utils-perf` package in the track-1 perf-test projects * so that the track 1 perf tests can leverage the perf framework. * * Additionally, this runs `npm install` in the track-1 perf test projects. @@ -21,18 +21,18 @@ function spawn(command) { } } -const navigateToPerfStressFolder = `cd ${path.resolve( +const navigateToPerfFolder = `cd ${path.resolve( "..", "..", "..", "test-utils", - "perfstress" + "perf" )}`; -const buildPerfStressPackage = `rush build -t test-utils-perfstress`; +const buildPerfPackage = `rush build -t test-utils-perf`; const rushxPack = `rushx pack`; -console.log(`\nGetting perfstress package...`); -spawn(`${navigateToPerfStressFolder} && ${buildPerfStressPackage} && ${rushxPack}`); +console.log(`\nGetting perf package...`); +spawn(`${navigateToPerfFolder} && ${buildPerfPackage} && ${rushxPack}`); console.log(`\nRunning "npm install"...`); spawn(`npm install`); diff --git a/dataplane.code-workspace b/dataplane.code-workspace index bb9154de271b..1c607eb9cec0 100644 --- a/dataplane.code-workspace +++ b/dataplane.code-workspace @@ -253,8 +253,8 @@ "path": "sdk/purview/purview-scanning-rest" }, { - "name": "perfstress", - "path": "sdk/test-utils/perfstress" + "name": "perf", + "path": "sdk/test-utils/perf" }, { "name": "multi-version test", diff --git a/eng/tools/rush-runner.js b/eng/tools/rush-runner.js index 010b8519b492..b6466ffe0e39 100644 --- a/eng/tools/rush-runner.js +++ b/eng/tools/rush-runner.js @@ -19,7 +19,7 @@ const reducedDependencyTestMatrix = { '@azure/storage-blob', '@azure/template', '@azure/test-utils', - '@azure/test-utils-perfstress', + '@azure/test-utils-perf', '@azure-tools/test-recorder', '@azure/synapse-monitoring' ], diff --git a/rush.json b/rush.json index 3329c0d8e9aa..ef8df819037d 100644 --- a/rush.json +++ b/rush.json @@ -712,8 +712,8 @@ "versionPolicyName": "utility" }, { - "packageName": "@azure/test-utils-perfstress", - "projectFolder": "sdk/test-utils/perfstress", + "packageName": "@azure/test-utils-perf", + "projectFolder": "sdk/test-utils/perf", "versionPolicyName": "utility" }, { @@ -982,4 +982,4 @@ "versionPolicyName": "management" } ] -} \ No newline at end of file +} diff --git a/sdk/appconfiguration/perf-tests/app-configuration/package.json b/sdk/appconfiguration/perf-tests/app-configuration/package.json index 9ce156db3a57..7b6971919670 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/package.json +++ b/sdk/appconfiguration/perf-tests/app-configuration/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/app-configuration": "^1.2.0-beta.2", "@azure/core-http": "^2.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/appconfiguration/perf-tests/app-configuration/test/appConfigBase.spec.ts b/sdk/appconfiguration/perf-tests/app-configuration/test/appConfigBase.spec.ts index cf6eaa5b22b6..508272cf441b 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/test/appConfigBase.spec.ts +++ b/sdk/appconfiguration/perf-tests/app-configuration/test/appConfigBase.spec.ts @@ -1,10 +1,10 @@ -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { AppConfigurationClient } from "@azure/app-configuration"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class AppConfigTest extends PerfStressTest { +export abstract class AppConfigTest extends PerfTest { client: AppConfigurationClient; constructor() { diff --git a/sdk/appconfiguration/perf-tests/app-configuration/test/index.spec.ts b/sdk/appconfiguration/perf-tests/app-configuration/test/index.spec.ts index 9ba6ac840be0..087f8d6ab71b 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/test/index.spec.ts +++ b/sdk/appconfiguration/perf-tests/app-configuration/test/index.spec.ts @@ -1,8 +1,8 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { ListSettingsTest } from "./listSettings.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([ListSettingsTest])); +const perfProgram = new PerfProgram(selectPerfTest([ListSettingsTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts index e0090e0594e1..520039664243 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts +++ b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { generateUuid } from "@azure/core-http"; -import { PerfStressOptionDictionary, executeParallel } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, executeParallel } from "@azure/test-utils-perf"; import { AppConfigTest } from "./appConfigBase.spec"; interface ListTestOptions { @@ -14,7 +14,7 @@ interface ListTestOptions { export class ListSettingsTest extends AppConfigTest { static prefix = generateUuid(); - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { count: { required: true, description: "Number of settings to be listed", diff --git a/sdk/containerregistry/perf-tests/container-registry/package.json b/sdk/containerregistry/perf-tests/container-registry/package.json index e47ff5e90396..7b64e8777019 100644 --- a/sdk/containerregistry/perf-tests/container-registry/package.json +++ b/sdk/containerregistry/perf-tests/container-registry/package.json @@ -8,7 +8,7 @@ "license": "ISC", "dependencies": { "@azure/container-registry": "1.0.0-beta.4", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/client.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/client.spec.ts index 831230932453..72fd25f6984e 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/client.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/client.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ContainerRegistryClient } from "@azure/container-registry"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class ContainerRegistryTest extends PerfStressTest { +export abstract class ContainerRegistryTest extends PerfTest { client: ContainerRegistryClient; constructor() { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts index fdf388643370..1fdd8d5777f2 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { ArtifactListTest } from "./listArtifacts.spec"; import { RepositoryListTest } from "./listRepositories.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([RepositoryListTest, ArtifactListTest]) +const perfProgram = new PerfProgram( + selectPerfTest([RepositoryListTest, ArtifactListTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts index dcdcd7d99d1a..f7af781734eb 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { ContainerRepository } from "@azure/container-registry"; import { ContainerRegistryTest, ContainerRegistryTestOptions } from "./client.spec"; export class ArtifactListTest extends ContainerRegistryTest { repository: ContainerRepository; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.repository = this.client.getRepository(getEnvVar("REPOSITORY_NAME")); diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts index 945f83a488bc..727168526767 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { ContainerRegistryTest, ContainerRegistryTestOptions } from "./client.spec"; export class RepositoryListTest extends ContainerRegistryTest { - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); } diff --git a/sdk/core/perf-tests/core-rest-pipeline/package.json b/sdk/core/perf-tests/core-rest-pipeline/package.json index 42c07e3f5e70..fea6e8ed1aef 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/package.json +++ b/sdk/core/perf-tests/core-rest-pipeline/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-auth": "^1.3.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts index 5eb1e1b7e085..1139109baf0c 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts +++ b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfTest } from "@azure/test-utils-perf"; import { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth"; import { AuthorizeRequestOnChallengeOptions, @@ -116,7 +116,7 @@ class MockRefreshAzureCredential implements TokenCredential { } } -export class BearerTokenAuthenticationPolicyChallengeTest extends PerfStressTest { +export class BearerTokenAuthenticationPolicyChallengeTest extends PerfTest { options = {}; constructor() { diff --git a/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts b/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts index f6c417937aa8..83a586fd3415 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts +++ b/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts @@ -1,10 +1,10 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { BearerTokenAuthenticationPolicyChallengeTest } from "./bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([BearerTokenAuthenticationPolicyChallengeTest]) +const perfProgram = new PerfProgram( + selectPerfTest([BearerTokenAuthenticationPolicyChallengeTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/eventgrid/perf-tests/eventgrid/package.json b/sdk/eventgrid/perf-tests/eventgrid/package.json index b4c70b8122d3..a6f16d219c07 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/package.json +++ b/sdk/eventgrid/perf-tests/eventgrid/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/eventgrid": "^4.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/eventgrid/perf-tests/eventgrid/test/index.spec.ts b/sdk/eventgrid/perf-tests/eventgrid/test/index.spec.ts index a888bdc12699..a1fc9457ea5a 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/test/index.spec.ts +++ b/sdk/eventgrid/perf-tests/eventgrid/test/index.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { SendCloudEventsTest } from "./sendCloudEvents.spec"; import dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([SendCloudEventsTest])); +const perfProgram = new PerfProgram(selectPerfTest([SendCloudEventsTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts index b0130d10338a..b8a2b4208c28 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts +++ b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. import { - PerfStressTest, - PerfStressOptionDictionary, + PerfTest, + PerfOptionDictionary, getEnvVar -} from "@azure/test-utils-perfstress"; +} from "@azure/test-utils-perf"; import { EventGridPublisherClient, AzureKeyCredential, @@ -16,8 +16,8 @@ interface SendCloudEventsPerfTestOptions { "event-count": number; } -export class SendCloudEventsTest extends PerfStressTest { - options: PerfStressOptionDictionary = { +export class SendCloudEventsTest extends PerfTest { + options: PerfOptionDictionary = { "event-count": { required: true, description: "Number of events to send in a single request", diff --git a/sdk/eventhub/event-hubs/package.json b/sdk/eventhub/event-hubs/package.json index 6e2de4f2975a..f2a6a4f93aa5 100644 --- a/sdk/eventhub/event-hubs/package.json +++ b/sdk/eventhub/event-hubs/package.json @@ -130,7 +130,7 @@ "@azure/identity": "2.0.0-beta.6", "@azure/mock-hub": "^1.0.0", "@azure/test-utils": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-inject": "^4.0.0", diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/README.md b/sdk/eventhub/perf-tests/event-hubs-track-1/README.md index 599dc7c6d5b1..711d0d6c6625 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/README.md +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/README.md @@ -20,7 +20,7 @@ Create an event-hubs namespace and populate the `.env` file with the following v > npm run perf-test:node -- SendTest --warmup 2 --duration 7 --parallel 2 - _Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/README.md#keyconcepts)._ + _Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/README.md#keyconcepts)._ - To test receiving messages (this test does not use the framework, is a standalone test) diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/package.json b/sdk/eventhub/perf-tests/event-hubs-track-1/package.json index 6ed0035a64fa..50561ac3605e 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/package.json +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/package.json @@ -10,7 +10,7 @@ "@azure/core-amqp": "^3.0.0", "@azure/event-hubs": "^2.1.4", "uuid": "^8.3.0", - "@azure/test-utils-perfstress": "file:../../../test-utils/perfstress/azure-test-utils-perfstress-1.0.0.tgz", + "@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz", "dotenv": "^8.2.0", "moment": "^2.24.0" }, diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/test/index.spec.ts b/sdk/eventhub/perf-tests/event-hubs-track-1/test/index.spec.ts index a72d02ad71eb..febad3a8522d 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/test/index.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/test/index.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { SendTest } from "./send.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([SendTest])); +const perfProgram = new PerfProgram(selectPerfTest([SendTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/test/receive.spec.ts b/sdk/eventhub/perf-tests/event-hubs-track-1/test/receive.spec.ts index 7fc2d6b4de62..10b604d6225f 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/test/receive.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/test/receive.spec.ts @@ -12,7 +12,7 @@ Measures the maximum throughput of `receiver.receive()` in package `@azure/event */ import { EventHubClient, EventPosition, EventData } from "@azure/event-hubs"; -import { getEnvVar } from "@azure/test-utils-perfstress"; +import { getEnvVar } from "@azure/test-utils-perf"; import moment from "moment"; import { delay } from "@azure/core-amqp"; diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts index 370186e2cab4..b37440f4af4c 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts @@ -3,9 +3,9 @@ import { getEnvVar, - PerfStressOptionDictionary, - PerfStressTest -} from "@azure/test-utils-perfstress"; + PerfOptionDictionary, + PerfTest +} from "@azure/test-utils-perf"; import { EventHubClient, EventData } from "@azure/event-hubs"; import { config } from "dotenv"; @@ -20,10 +20,10 @@ interface SendTestOptions { } const client = EventHubClient.createFromConnectionString(connectionString, eventHubName); -export class SendTest extends PerfStressTest { +export class SendTest extends PerfTest { producer: EventHubClient; eventBatch: EventData[]; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { eventBodySize: { required: true, description: "Size in bytes", diff --git a/sdk/eventhub/perf-tests/event-hubs/README.md b/sdk/eventhub/perf-tests/event-hubs/README.md index 2224bd2147a2..790eb609bd69 100644 --- a/sdk/eventhub/perf-tests/event-hubs/README.md +++ b/sdk/eventhub/perf-tests/event-hubs/README.md @@ -17,7 +17,7 @@ Create an event-hubs namespace and populate the `.env` file with the following v > npm run perf-test:node -- SendTest --warmup 2 --duration 7 --parallel 2 - _Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/README.md#keyconcepts)._ + _Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/README.md#keyconcepts)._ - To test receiving messages (this test does not use the framework, is a standalone test) diff --git a/sdk/eventhub/perf-tests/event-hubs/package.json b/sdk/eventhub/perf-tests/event-hubs/package.json index 12b8f7f64063..5a68da58d1bc 100644 --- a/sdk/eventhub/perf-tests/event-hubs/package.json +++ b/sdk/eventhub/perf-tests/event-hubs/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/event-hubs": "^5.6.0", "@azure/core-amqp": "^3.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "moment": "^2.24.0", "uuid": "^8.3.0" diff --git a/sdk/eventhub/perf-tests/event-hubs/test/index.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/index.spec.ts index a72d02ad71eb..febad3a8522d 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/index.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/index.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { SendTest } from "./send.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([SendTest])); +const perfProgram = new PerfProgram(selectPerfTest([SendTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/eventhub/perf-tests/event-hubs/test/receive.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/receive.spec.ts index aebe9e79277f..4c49238e0499 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/receive.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/receive.spec.ts @@ -21,7 +21,7 @@ import { PartitionContext, EventHubProducerClient } from "@azure/event-hubs"; -import { getEnvVar } from "@azure/test-utils-perfstress"; +import { getEnvVar } from "@azure/test-utils-perf"; import moment from "moment"; import { delay } from "@azure/core-amqp"; diff --git a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts index 7683b1724d5a..64a4b7b1f99e 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts @@ -3,9 +3,9 @@ import { getEnvVar, - PerfStressOptionDictionary, - PerfStressTest -} from "@azure/test-utils-perfstress"; + PerfOptionDictionary, + PerfTest +} from "@azure/test-utils-perf"; import { EventHubProducerClient, EventData } from "@azure/event-hubs"; // Expects the .env file at the same level as the "test" folder @@ -21,10 +21,10 @@ const connectionString = getEnvVar("EVENTHUB_CONNECTION_STRING"); const eventHubName = getEnvVar("EVENTHUB_NAME"); const producer = new EventHubProducerClient(connectionString, eventHubName); -export class SendTest extends PerfStressTest { +export class SendTest extends PerfTest { producer: EventHubProducerClient; eventBatch: EventData[]; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { eventBodySize: { required: true, description: "Size in bytes", diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json b/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json index bb05a686b2f9..74df7a13c318 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json @@ -11,7 +11,7 @@ "dependencies": { "@azure/ai-form-recognizer": "3.1.0-beta.3", "@azure/identity": "2.0.0-beta.5", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "tslib": "^2.2.0" }, diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts index b092a212a7a0..8d3cb6556ece 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. import { - PerfStressOptionDictionary, - PerfStressTest, + PerfOptionDictionary, + PerfTest, getEnvVar -} from "@azure/test-utils-perfstress"; +} from "@azure/test-utils-perf"; import { AzureKeyCredential, BeginRecognizeCustomFormsOptions, @@ -19,8 +19,8 @@ function unreachable(message?: string): never { throw new Error(message ?? "Unreachable Exception."); } -export class CustomModelRecognitionTest extends PerfStressTest { - public options: PerfStressOptionDictionary = { +export class CustomModelRecognitionTest extends PerfTest { + public options: PerfOptionDictionary = { updateIntervalInMs: { required: false, description: "Polling interval in milliseconds", diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/index.spec.ts b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/index.spec.ts index 05418cef68f3..b2f7f9056060 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/index.spec.ts +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/index.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { CustomModelRecognitionTest } from "./custom.spec"; import dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([CustomModelRecognitionTest])); +const perfProgram = new PerfProgram(selectPerfTest([CustomModelRecognitionTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/identity/perf-tests/identity/package.json b/sdk/identity/perf-tests/identity/package.json index e44100faf668..5527e9364c84 100644 --- a/sdk/identity/perf-tests/identity/package.json +++ b/sdk/identity/perf-tests/identity/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/identity": "^2.0.0-beta.6", "@azure/identity-cache-persistence": "~1.0.0-beta.1", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts index 00a71106650f..c35b73c07acc 100644 --- a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts +++ b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { useIdentityPlugin, ClientSecretCredential } from "@azure/identity"; import { cachePersistencePlugin } from "@azure/identity-cache-persistence"; @@ -9,7 +9,7 @@ const scope = `https://servicebus.azure.net/.default`; /** * This test does silent authentication with persistence enabled. */ -export class ClientSecretCredentialPersistenceTest extends PerfStressTest { +export class ClientSecretCredentialPersistenceTest extends PerfTest { options = {}; static credential: ClientSecretCredential; diff --git a/sdk/identity/perf-tests/identity/test/index.spec.ts b/sdk/identity/perf-tests/identity/test/index.spec.ts index db2d7cec4302..af05fbe657b6 100644 --- a/sdk/identity/perf-tests/identity/test/index.spec.ts +++ b/sdk/identity/perf-tests/identity/test/index.spec.ts @@ -1,12 +1,12 @@ import { ClientSecretCredentialPersistenceTest } from "./ClientSecretCredential/persistence.spec"; -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import * as dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ClientSecretCredentialPersistenceTest]) +const perfProgram = new PerfProgram( + selectPerfTest([ClientSecretCredentialPersistenceTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/package.json b/sdk/keyvault/perf-tests/keyvault-certificates/package.json index fbad72b02691..b4dd1cef7359 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/package.json +++ b/sdk/keyvault/perf-tests/keyvault-certificates/package.json @@ -8,7 +8,7 @@ "author": "", "license": "ISC", "dependencies": { - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "@azure/identity": "2.0.0-beta.5", "uuid": "^8.3.0", diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts index a831790728a4..383421e0fdfe 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts @@ -1,9 +1,9 @@ -import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfTest } from "@azure/test-utils-perf"; import { credential, keyVaultUri } from "./utils"; import { CertificateClient, WellKnownIssuer } from "@azure/keyvault-certificates"; import { v4 as uuid } from "uuid"; -export abstract class CertificateTest extends PerfStressTest { +export abstract class CertificateTest extends PerfTest { options = {}; certificateClient: CertificateClient; static certificateName = `c-${uuid()}`; diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/test/index.spec.ts b/sdk/keyvault/perf-tests/keyvault-certificates/test/index.spec.ts index 7e2c766c0a55..ccc411f964c7 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/test/index.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-certificates/test/index.spec.ts @@ -1,8 +1,8 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { GetCertificateTest } from "./getCertificate.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([GetCertificateTest])); +const perfProgram = new PerfProgram(selectPerfTest([GetCertificateTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/test/utils.ts b/sdk/keyvault/perf-tests/keyvault-certificates/test/utils.ts index cdc77c535572..cab69de22adf 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/test/utils.ts +++ b/sdk/keyvault/perf-tests/keyvault-certificates/test/utils.ts @@ -1,5 +1,5 @@ import { ClientSecretCredential } from "@azure/identity"; -import { getEnvVar } from "@azure/test-utils-perfstress"; +import { getEnvVar } from "@azure/test-utils-perf"; import * as dotenv from "dotenv"; dotenv.config(); diff --git a/sdk/keyvault/perf-tests/keyvault-keys/package.json b/sdk/keyvault/perf-tests/keyvault-keys/package.json index c9d5b6a9a6fb..59a4289ea94c 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/package.json +++ b/sdk/keyvault/perf-tests/keyvault-keys/package.json @@ -8,7 +8,7 @@ "author": "", "license": "ISC", "dependencies": { - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@azure/keyvault-keys": "^4.2.1", "dotenv": "^8.2.0", "@azure/identity": "2.0.0-beta.6", diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/cryptography.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/cryptography.spec.ts index 490552474bb2..0f6958b5e199 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/cryptography.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/cryptography.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary, PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, PerfTest } from "@azure/test-utils-perf"; import { CryptographyClient, KeyClient } from "@azure/keyvault-keys"; import { v4 as uuid } from "uuid"; import { credential, keyVaultUri } from "../utils"; @@ -7,8 +7,8 @@ interface CryptographyPerfTestOptions { keySize: number; } -export abstract class CryptographyTest extends PerfStressTest { - options: PerfStressOptionDictionary = { +export abstract class CryptographyTest extends PerfTest { + options: PerfOptionDictionary = { keySize: { required: false, description: "The size of the key to be created", diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/index.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/index.spec.ts index 08352afff0be..bae65b2ed9ba 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/index.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/index.spec.ts @@ -1,13 +1,13 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { GetKeyTest } from "./keys/get.spec"; import { DecryptTest } from "./cryptography/decrypt.spec"; import { SignTest } from "./cryptography/sign.spec"; import { UnwrapKeyTest } from "./cryptography/unwrapKey.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([GetKeyTest, DecryptTest, SignTest, UnwrapKeyTest]) +const perfProgram = new PerfProgram( + selectPerfTest([GetKeyTest, DecryptTest, SignTest, UnwrapKeyTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts index ef558e75876d..982840fc27db 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary, PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, PerfTest } from "@azure/test-utils-perf"; import { KeyClient } from "@azure/keyvault-keys"; import { credential, keyVaultUri } from "../utils"; import { v4 as uuid } from "uuid"; @@ -7,8 +7,8 @@ interface KeyPerfTestOptions { keySize: number; } -export abstract class KeyTest extends PerfStressTest { - options: PerfStressOptionDictionary = { +export abstract class KeyTest extends PerfTest { + options: PerfOptionDictionary = { keySize: { required: false, description: "The size of the key to be created", diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/utils.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/utils.ts index cdc77c535572..cab69de22adf 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/utils.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/utils.ts @@ -1,5 +1,5 @@ import { ClientSecretCredential } from "@azure/identity"; -import { getEnvVar } from "@azure/test-utils-perfstress"; +import { getEnvVar } from "@azure/test-utils-perf"; import * as dotenv from "dotenv"; dotenv.config(); diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/package.json b/sdk/keyvault/perf-tests/keyvault-secrets/package.json index 68982d0abd4b..ad198f66e39c 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/package.json +++ b/sdk/keyvault/perf-tests/keyvault-secrets/package.json @@ -8,7 +8,7 @@ "author": "", "license": "ISC", "dependencies": { - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "@azure/identity": "2.0.0-beta.5", "uuid": "^8.3.0", diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts index faabdc53d0ec..978ce0a13820 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts @@ -1,11 +1,11 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { GetSecretTest } from "./getSecret.spec"; import { ListSecretsTest } from "./listSecrets.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([GetSecretTest, ListSecretsTest]) +const perfProgram = new PerfProgram( + selectPerfTest([GetSecretTest, ListSecretsTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts index 12786c95ad6c..a2d691b25ac9 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { SecretTest } from "./secretTest"; import { v4 as uuid } from "uuid"; @@ -8,7 +8,7 @@ interface ListSecretPerfTestOptions { export class ListSecretsTest extends SecretTest { static secretsToDelete: string[] = []; - options: PerfStressOptionDictionary = { + options: PerfOptionDictionary = { count: { required: false, description: "The number of secrets to create", diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts index b2b2123a130b..7444230dcd72 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts @@ -1,8 +1,8 @@ import { SecretClient } from "@azure/keyvault-secrets"; -import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfTest } from "@azure/test-utils-perf"; import { keyVaultUri, credential } from "./utils"; -export abstract class SecretTest> extends PerfStressTest< +export abstract class SecretTest> extends PerfTest< TOptions > { secretClient: SecretClient; diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/utils.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/utils.ts index cdc77c535572..cab69de22adf 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/utils.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/utils.ts @@ -1,5 +1,5 @@ import { ClientSecretCredential } from "@azure/identity"; -import { getEnvVar } from "@azure/test-utils-perfstress"; +import { getEnvVar } from "@azure/test-utils-perf"; import * as dotenv from "dotenv"; dotenv.config(); diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/package.json b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/package.json index 6e42f569eb69..c20015498d94 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/package.json +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/ai-metrics-advisor": "1.0.0-beta.3", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/index.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/index.spec.ts index 580889b960b2..847463a61fb6 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/index.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/index.spec.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { AnomaliesListTest } from "./listAnomalies.spec"; import { IncidentsListTest } from "./listIncidents.spec"; import { RootCauseTest } from "./rootCauses.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([AnomaliesListTest, IncidentsListTest, RootCauseTest]) +const perfProgram = new PerfProgram( + selectPerfTest([AnomaliesListTest, IncidentsListTest, RootCauseTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts index 670cd3f9d5bf..20c36482c1ed 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { MetricsAdvisorTest } from "./metricsAdvisor.spec"; type MetricsAdvisorTestOptions = Record; export class AnomaliesListTest extends MetricsAdvisorTest { alertId: string; alertConfigId: string; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.alertId = getEnvVar("METRICS_ADVISOR_ALERT_ID"); diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts index 13dc294d72f9..07fca2b61680 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { MetricsAdvisorTest } from "./metricsAdvisor.spec"; type MetricsAdvisorTestOptions = Record; export class IncidentsListTest extends MetricsAdvisorTest { alertId: string; alertConfigId: string; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.alertId = getEnvVar("METRICS_ADVISOR_ALERT_ID"); diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/metricsAdvisor.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/metricsAdvisor.spec.ts index 0ea8e4374934..c17519df8c5f 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/metricsAdvisor.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/metricsAdvisor.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { MetricsAdvisorClient, MetricsAdvisorKeyCredential } from "@azure/ai-metrics-advisor"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class MetricsAdvisorTest extends PerfStressTest { +export abstract class MetricsAdvisorTest extends PerfTest { client: MetricsAdvisorClient; constructor() { diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts index fb389be5c098..ae1069e5f046 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { MetricsAdvisorTest } from "./metricsAdvisor.spec"; type MetricsAdvisorTestOptions = Record; export class RootCauseTest extends MetricsAdvisorTest { detectionConfigId: string; incidentId: string; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.detectionConfigId = getEnvVar("METRICS_ADVISOR_DETECTION_CONFIG_ID"); diff --git a/sdk/monitor/perf-tests/monitor-query/package.json b/sdk/monitor/perf-tests/monitor-query/package.json index fdf1750f743d..c19ed140fb58 100644 --- a/sdk/monitor/perf-tests/monitor-query/package.json +++ b/sdk/monitor/perf-tests/monitor-query/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/monitor-query": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "@azure/identity": "^2.0.0" }, diff --git a/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts index d581e2a242d0..7a091c71897b 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { MetricsQueryTest } from "./metricQuery.spec"; import { LogQueryBatchTest } from "./logQueryBatch.spec"; import { LogQueryTest } from "./logQuery.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([MetricsQueryTest, LogQueryBatchTest, LogQueryTest]) +const perfProgram = new PerfProgram( + selectPerfTest([MetricsQueryTest, LogQueryBatchTest, LogQueryTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts index d76aafa44071..439e671aea51 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { MonitorQueryLog } from "./monitorQueryLog.spec"; type MonitorQueryTestOptions = Record; @@ -8,7 +8,7 @@ type MonitorQueryTestOptions = Record; export class LogQueryTest extends MonitorQueryLog { workspaceId: string; query: string; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts index 7630014a82e7..025bbd2d0566 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { MonitorQueryLog } from "./monitorQueryLog.spec"; import { QueryBatch } from "@azure/monitor-query"; @@ -9,7 +9,7 @@ type MonitorQueryTestOptions = Record; export class LogQueryBatchTest extends MonitorQueryLog { workspaceId: string; queryBatch: QueryBatch[]; - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); diff --git a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts index 37dbf42fdf53..d1e1a20edfba 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { AggregationType } from "@azure/monitor-query"; import { MonitorQueryMetrics } from "./monitorQueryMetrics.spec"; @@ -10,7 +10,7 @@ export class MetricsQueryTest extends MonitorQueryMetrics = {}; + public options: PerfOptionDictionary = {}; constructor() { super(); this.metricsUri = getEnvVar("METRICS_RESOURCE_ID"); diff --git a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts index c4023c679441..bbfcb6f36129 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfTest } from "@azure/test-utils-perf"; import { LogsQueryClient } from "@azure/monitor-query"; import { DefaultAzureCredential } from "@azure/identity"; @@ -9,7 +9,7 @@ import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; dotenv.config(); -export abstract class MonitorQueryLog extends PerfStressTest { +export abstract class MonitorQueryLog extends PerfTest { client: LogsQueryClient; constructor() { diff --git a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts index 07dfc433b8d7..fd478f23d97e 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfTest } from "@azure/test-utils-perf"; import { MetricsQueryClient } from "@azure/monitor-query"; import { DefaultAzureCredential } from "@azure/identity"; @@ -9,7 +9,7 @@ import { DefaultAzureCredential } from "@azure/identity"; import * as dotenv from "dotenv"; dotenv.config(); -export abstract class MonitorQueryMetrics extends PerfStressTest { +export abstract class MonitorQueryMetrics extends PerfTest { client: MetricsQueryClient; constructor() { diff --git a/sdk/search/perf-tests/search-documents/package.json b/sdk/search/perf-tests/search-documents/package.json index a4e73b3c1f18..c08172c3770f 100644 --- a/sdk/search/perf-tests/search-documents/package.json +++ b/sdk/search/perf-tests/search-documents/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/identity": "2.0.0-beta.5", "@azure/search-documents": "11.3.0-beta.4", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts index c33e91b6ad19..5c00ba06cc46 100644 --- a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts @@ -1,8 +1,8 @@ import { SearchDocumentsBase, SearchDocumentsTestOptions } from "./core/searchDocumentsBase.spec"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; export class AutoCompleteTest extends SearchDocumentsBase { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { documentsCount: { required: true, description: "Number of Documents to be created", diff --git a/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts b/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts index 545bbefde80e..cbfccdcdeb2f 100644 --- a/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { SearchClient, AzureKeyCredential, @@ -15,7 +15,7 @@ export interface SearchDocumentsTestOptions { export abstract class SearchDocumentsBase< TOptions = Record -> extends PerfStressTest { +> extends PerfTest { searchIndexClient: SearchIndexClient; searchClient: SearchClient; indexName: string; diff --git a/sdk/search/perf-tests/search-documents/test/index.spec.ts b/sdk/search/perf-tests/search-documents/test/index.spec.ts index b890db7613b7..7717250a1b16 100644 --- a/sdk/search/perf-tests/search-documents/test/index.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/index.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { AutoCompleteTest } from "./autoCompleteTest.spec"; import { IndexDocumentsTest } from "./indexDocumentsTest.spec"; import { SearchDocumentsTest } from "./searchDocumentsTest.spec"; @@ -10,10 +10,10 @@ import { SuggestTest } from "./suggestTest.spec"; import dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([AutoCompleteTest, IndexDocumentsTest, SearchDocumentsTest, SuggestTest]) +const perfProgram = new PerfProgram( + selectPerfTest([AutoCompleteTest, IndexDocumentsTest, SearchDocumentsTest, SuggestTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts index 618dd70902ce..84f5d5524b8c 100644 --- a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts @@ -1,11 +1,11 @@ import { SearchDocumentsBase, SearchDocumentsTestOptions } from "./core/searchDocumentsBase.spec"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { generateHotels } from "./core/documentsGenerator"; import { Hotel } from "./core/hotel"; import { IndexDocumentsBatch } from "@azure/search-documents"; export class IndexDocumentsTest extends SearchDocumentsBase { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { documentsCount: { required: true, description: "Number of Documents to be created", diff --git a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts index daa9f2380158..371dfba92ed2 100644 --- a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts @@ -1,8 +1,8 @@ import { SearchDocumentsBase, SearchDocumentsTestOptions } from "./core/searchDocumentsBase.spec"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; export class SearchDocumentsTest extends SearchDocumentsBase { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { documentsCount: { required: true, description: "Number of Documents to be created", diff --git a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts index 8c81cb94b2cd..fc3663c13367 100644 --- a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts @@ -1,8 +1,8 @@ import { SearchDocumentsBase, SearchDocumentsTestOptions } from "./core/searchDocumentsBase.spec"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; export class SuggestTest extends SearchDocumentsBase { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { documentsCount: { required: true, description: "Number of Documents to be created", diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/README.md b/sdk/servicebus/perf-tests/service-bus-track-1/README.md index ce9629c98087..18a2d3991e77 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/README.md +++ b/sdk/servicebus/perf-tests/service-bus-track-1/README.md @@ -18,4 +18,4 @@ To test sending messages in batches > `npm run perf-test:node -- BatchSendTest --warmup 1 --duration 25 --iterations 2 --parallel 32 --messageBodySize 10240 --numberOfMessages 10` -_Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/README.md#keyconcepts)._ +_Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/README.md#keyconcepts)._ diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/package.json b/sdk/servicebus/perf-tests/service-bus-track-1/package.json index 93b98ca65dfb..f8706842b004 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/package.json +++ b/sdk/servicebus/perf-tests/service-bus-track-1/package.json @@ -9,7 +9,7 @@ "dependencies": { "@azure/service-bus": "^1.1.10", "@azure/service-bus-v7": "npm:@azure/service-bus@^7.0.0", - "@azure/test-utils-perfstress": "file:../../../test-utils/perfstress/azure-test-utils-perfstress-1.0.0.tgz", + "@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/test/index.spec.ts b/sdk/servicebus/perf-tests/service-bus-track-1/test/index.spec.ts index a186da32216a..08d3f43f4fa2 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/test/index.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus-track-1/test/index.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { BatchSendTest } from "./sendBatch.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([BatchSendTest])); +const perfProgram = new PerfProgram(selectPerfTest([BatchSendTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/test/sbBase.spec.ts b/sdk/servicebus/perf-tests/service-bus-track-1/test/sbBase.spec.ts index e814b6ac13b1..3095ef790573 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/test/sbBase.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus-track-1/test/sbBase.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ServiceBusClient } from "@azure/service-bus"; import { ServiceBusAdministrationClient } from "@azure/service-bus-v7"; @@ -11,7 +11,7 @@ dotenv.config(); const connectionString = getEnvVar("SERVICEBUS_CONNECTION_STRING"); -export abstract class ServiceBusTest extends PerfStressTest { +export abstract class ServiceBusTest extends PerfTest { static sbClient: ServiceBusClient = ServiceBusClient.createFromConnectionString(connectionString); static sbAdminClient = new ServiceBusAdministrationClient(connectionString); static queueName = `newqueue-${Math.ceil(Math.random() * 1000)}`; diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts index e2736f525349..23cf13cb86b5 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { SendableMessageInfo } from "@azure/service-bus"; import { ServiceBusTest } from "./sbBase.spec"; @@ -13,7 +13,7 @@ interface SendTestOptions { export class BatchSendTest extends ServiceBusTest { static sender = ServiceBusTest.sbClient.createQueueClient(BatchSendTest.queueName).createSender(); batch: SendableMessageInfo[]; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { messageBodySize: { required: true, description: "Size in bytes", diff --git a/sdk/servicebus/perf-tests/service-bus/README.md b/sdk/servicebus/perf-tests/service-bus/README.md index c058c3556e1a..0b42e37e5c87 100644 --- a/sdk/servicebus/perf-tests/service-bus/README.md +++ b/sdk/servicebus/perf-tests/service-bus/README.md @@ -15,4 +15,4 @@ To test sending messages in batches > `npm run perf-test:node -- BatchSendTest --warmup 1 --duration 25 --iterations 2 --parallel 32 --messageBodySize 10240 --numberOfMessages 10` -_Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/README.md#keyconcepts)._ +_Note: For more default options, refer [Perf-Framework-Default-Options](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/README.md#keyconcepts)._ diff --git a/sdk/servicebus/perf-tests/service-bus/package.json b/sdk/servicebus/perf-tests/service-bus/package.json index 5a285838db3d..e5a83b43d6ba 100644 --- a/sdk/servicebus/perf-tests/service-bus/package.json +++ b/sdk/servicebus/perf-tests/service-bus/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/service-bus": "^7.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/servicebus/perf-tests/service-bus/test/index.spec.ts b/sdk/servicebus/perf-tests/service-bus/test/index.spec.ts index a186da32216a..08d3f43f4fa2 100644 --- a/sdk/servicebus/perf-tests/service-bus/test/index.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus/test/index.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { BatchSendTest } from "./sendBatch.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([BatchSendTest])); +const perfProgram = new PerfProgram(selectPerfTest([BatchSendTest])); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/servicebus/perf-tests/service-bus/test/sbBase.spec.ts b/sdk/servicebus/perf-tests/service-bus/test/sbBase.spec.ts index f12d9140cf94..c6bd02a3f5d5 100644 --- a/sdk/servicebus/perf-tests/service-bus/test/sbBase.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus/test/sbBase.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ServiceBusAdministrationClient, ServiceBusClient } from "@azure/service-bus"; // Expects the .env file at the same level as the "test" folder @@ -10,7 +10,7 @@ dotenv.config(); const connectionString = getEnvVar("SERVICEBUS_CONNECTION_STRING"); -export abstract class ServiceBusTest extends PerfStressTest { +export abstract class ServiceBusTest extends PerfTest { static sbClient: ServiceBusClient = new ServiceBusClient(connectionString); static sbAdminClient = new ServiceBusAdministrationClient(connectionString); static queueName = `newqueue-${Math.ceil(Math.random() * 1000)}`; diff --git a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts index 0ff4be31a17a..af512d53b85f 100644 --- a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { ServiceBusMessage, ServiceBusSender } from "@azure/service-bus"; import { ServiceBusTest } from "./sbBase.spec"; @@ -13,7 +13,7 @@ interface SendTestOptions { export class BatchSendTest extends ServiceBusTest { static sender: ServiceBusSender = ServiceBusTest.sbClient.createSender(BatchSendTest.queueName); batch: ServiceBusMessage[]; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { messageBodySize: { required: true, description: "Size in bytes", diff --git a/sdk/servicebus/service-bus/package.json b/sdk/servicebus/service-bus/package.json index 351e175bc680..9c3a31c5a011 100644 --- a/sdk/servicebus/service-bus/package.json +++ b/sdk/servicebus/service-bus/package.json @@ -132,7 +132,7 @@ "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "2.0.0-beta.6", "@azure/test-utils": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-inject": "^4.0.0", diff --git a/sdk/storage/perf-tests/storage-blob-track-1/package.json b/sdk/storage/perf-tests/storage-blob-track-1/package.json index 3f148929e965..74d20e2647b3 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/package.json +++ b/sdk/storage/perf-tests/storage-blob-track-1/package.json @@ -9,7 +9,7 @@ "license": "ISC", "devDependencies": { "@azure/storage-blob": "^10.5.0", - "@azure/test-utils-perfstress": "file:../../../test-utils/perfstress/azure-test-utils-perfstress-1.0.0.tgz", + "@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz", "@types/node": "^12.0.0", "@types/uuid": "^8.0.0", "dotenv": "^8.2.0", diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts index a0f5cfc82f2a..56935ff8613c 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts @@ -3,7 +3,7 @@ import { v4 as generateUuid } from "uuid"; import { Aborter, BlobURL, BlockBlobURL } from "@azure/storage-blob"; -import { PerfStressOptionDictionary, drainStream } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, drainStream } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; interface StorageBlobDownloadTestOptions { @@ -11,7 +11,7 @@ interface StorageBlobDownloadTestOptions { } export class StorageBlobDownloadTest extends StorageBlobTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/index.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/index.spec.ts index 9f84b9c18373..d0a61954727f 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/index.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/index.spec.ts @@ -1,15 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { StorageBlobDownloadTest } from "./download.spec"; import { StorageBlobUploadTest } from "./upload.spec"; import { StorageBlobListTest } from "./listBlobs.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([StorageBlobDownloadTest, StorageBlobUploadTest, StorageBlobListTest]) +const perfProgram = new PerfProgram( + selectPerfTest([StorageBlobDownloadTest, StorageBlobUploadTest, StorageBlobListTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts index 4cab2aba9a44..39e5ab1871a7 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts @@ -3,14 +3,14 @@ import { v4 as generateUuid } from "uuid"; import { Aborter, BlockBlobURL } from "@azure/storage-blob"; -import { executeParallel, PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { executeParallel, PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; interface StorageBlobListTestOptions { count: number; } export class StorageBlobListTest extends StorageBlobTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { count: { required: true, description: "Number of blobs to be listed", diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/storageTest.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/storageTest.spec.ts index 6e4aee6b999a..25bc9d1d5945 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/storageTest.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/storageTest.spec.ts @@ -9,13 +9,13 @@ import { SharedKeyCredential, StorageURL } from "@azure/storage-blob"; -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class StorageBlobTest extends PerfStressTest { +export abstract class StorageBlobTest extends PerfTest { blobServiceClient: ServiceURL; containerClient: ContainerURL; static containerName = generateUuid(); diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts index f05614eaf923..95ca85734415 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts @@ -3,7 +3,7 @@ import { v4 as generateUuid } from "uuid"; import { Aborter, BlockBlobURL } from "@azure/storage-blob"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; interface StorageBlobUploadTestOptions { size: number; @@ -13,7 +13,7 @@ export class StorageBlobUploadTest extends StorageBlobTest = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-blob/package.json b/sdk/storage/perf-tests/storage-blob/package.json index 15a6023f6091..2ebcbf2ab0c5 100644 --- a/sdk/storage/perf-tests/storage-blob/package.json +++ b/sdk/storage/perf-tests/storage-blob/package.json @@ -11,7 +11,7 @@ "@azure/core-http": "^2.0.0", "@azure/core-rest-pipeline": "^1.1.0", "@azure/storage-blob": "^12.8.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts index b46ecaf41f3c..aff17f7431b6 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts @@ -3,7 +3,7 @@ import { StorageBlobDownloadWithSASTest } from "./dowloadWithSAS.spec"; import { ServiceClient, WebResource } from "@azure/core-http"; -import { drainStream } from "@azure/test-utils-perfstress"; +import { drainStream } from "@azure/test-utils-perf"; export class CoreHTTPDownloadWithSASTest extends StorageBlobDownloadWithSASTest { client: ServiceClient; diff --git a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts index dd2b494a0032..3de80a43f516 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts @@ -8,7 +8,7 @@ import { createPipelineRequest, PipelineRequest } from "@azure/core-rest-pipeline"; -import { drainStream } from "@azure/test-utils-perfstress"; +import { drainStream } from "@azure/test-utils-perf"; export class CoreHTTPSDownloadWithSASTest extends StorageBlobDownloadWithSASTest { client: HttpClient; diff --git a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts index c3323cf5b0e5..baf44414e03d 100644 --- a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, getEnvVar, drainStream } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, getEnvVar, drainStream } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; import { BlockBlobClient, @@ -19,7 +19,7 @@ interface StorageBlobDownloadTestOptions { export class StorageBlobDownloadWithSASTest extends StorageBlobTest< StorageBlobDownloadTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts index 95591610d306..3070850babe9 100644 --- a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { drainStream, PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { drainStream, PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; import { BlockBlobClient } from "@azure/storage-blob"; import { generateUuid } from "@azure/core-http"; @@ -11,7 +11,7 @@ interface StorageBlobDownloadTestOptions { } export class StorageBlobDownloadTest extends StorageBlobTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-blob/test/index.spec.ts b/sdk/storage/perf-tests/storage-blob/test/index.spec.ts index a6af3f477839..fc08017893e3 100644 --- a/sdk/storage/perf-tests/storage-blob/test/index.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/index.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { StorageBlobDownloadTest } from "./download.spec"; import { StorageBlobUploadTest } from "./upload.spec"; import { StorageBlobUploadFileTest } from "./uploadFromFile.spec"; @@ -11,10 +11,10 @@ import { CoreHTTPDownloadWithSASTest } from "./core-http.spec"; import { NodeFetchDownloadWithSASTest } from "./node-fetch.spec"; import { CoreHTTPSDownloadWithSASTest } from "./core-rest-pipeline.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ +const perfProgram = new PerfProgram( + selectPerfTest([ StorageBlobDownloadTest, StorageBlobUploadTest, StorageBlobUploadFileTest, @@ -26,4 +26,4 @@ const perfStressProgram = new PerfStressProgram( ]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts index 88070c3c8e7f..c157f109d070 100644 --- a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts @@ -2,14 +2,14 @@ // Licensed under the MIT license. import { generateUuid } from "@azure/core-http"; -import { PerfStressOptionDictionary, executeParallel } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, executeParallel } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; interface StorageBlobListTestOptions { count: number; } export class StorageBlobListTest extends StorageBlobTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { count: { required: true, description: "Number of blobs to be listed", diff --git a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts index b44859c657ab..a65ac155cfb3 100644 --- a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts @@ -4,7 +4,7 @@ import { StorageBlobDownloadWithSASTest } from "./dowloadWithSAS.spec"; import node_fetch from "node-fetch"; import https from "https"; -import { drainStream } from "@azure/test-utils-perfstress"; +import { drainStream } from "@azure/test-utils-perf"; export class NodeFetchDownloadWithSASTest extends StorageBlobDownloadWithSASTest { agent: https.Agent; constructor() { diff --git a/sdk/storage/perf-tests/storage-blob/test/storageTest.spec.ts b/sdk/storage/perf-tests/storage-blob/test/storageTest.spec.ts index fc4d8d9c01fa..ebbe1cce3dee 100644 --- a/sdk/storage/perf-tests/storage-blob/test/storageTest.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/storageTest.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { generateUuid } from "@azure/core-http"; -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { BlobServiceClient, ContainerClient, @@ -14,7 +14,7 @@ import { getValueInConnString } from "./utils/utils"; import * as dotenv from "dotenv"; dotenv.config(); -export abstract class StorageBlobTest extends PerfStressTest { +export abstract class StorageBlobTest extends PerfTest { blobServiceClient: BlobServiceClient; containerClient: ContainerClient; sharedKeyCredential: StorageSharedKeyCredential; diff --git a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts index 3f057f9d618d..6ee36a2bdb21 100644 --- a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { generateUuid } from "@azure/core-http"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageBlobTest } from "./storageTest.spec"; interface StorageBlobUploadTestOptions { @@ -12,7 +12,7 @@ interface StorageBlobUploadTestOptions { export class StorageBlobUploadTest extends StorageBlobTest { blobName: string; buffer: Buffer; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-datalake/package.json b/sdk/storage/perf-tests/storage-file-datalake/package.json index bdcd6d69cc34..78efe52b8965 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/package.json +++ b/sdk/storage/perf-tests/storage-file-datalake/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/storage-file-datalake": "^12.7.1", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts index b1c57e2d1483..afe05cc6d9d5 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageDFSTest } from "./storageTest.spec"; import { DataLakeFileClient } from "@azure/storage-file-datalake"; import { v4 as generateUuid } from "uuid"; @@ -11,7 +11,7 @@ interface StorageDFSAppendTestOptions { export class StorageDFSAppendTest extends StorageDFSTest { buffer: Buffer; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size to append in bytes", diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/index.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/index.spec.ts index 930355e11fe0..8055807b1a3d 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/index.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/index.spec.ts @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { StorageDFSAppendTest } from "./append.spec"; import { StorageDFSReadTest } from "./read.spec"; import { StorageDFSUploadTest } from "./upload.spec"; import { StorageDFSUploadFromFileTest } from "./uploadFromFile.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ +const perfProgram = new PerfProgram( + selectPerfTest([ StorageDFSAppendTest, StorageDFSReadTest, StorageDFSUploadTest, @@ -18,4 +18,4 @@ const perfStressProgram = new PerfStressProgram( ]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts index 1c0904a1ab97..57e11be25924 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { drainStream, PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { drainStream, PerfOptionDictionary } from "@azure/test-utils-perf"; import { StorageDFSTest } from "./storageTest.spec"; import { DataLakeFileClient } from "@azure/storage-file-datalake"; import { v4 as generateUuid } from "uuid"; @@ -10,7 +10,7 @@ interface StorageDFSReadTestOptions { } export class StorageDFSReadTest extends StorageDFSTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/storageTest.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/storageTest.spec.ts index 113186ce89bf..7e7719c6aac7 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/storageTest.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/storageTest.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getEnvVar, PerfStressTest } from "@azure/test-utils-perfstress"; +import { getEnvVar, PerfTest } from "@azure/test-utils-perf"; import { DataLakeServiceClient, @@ -15,7 +15,7 @@ import * as dotenv from "dotenv"; import { v4 as generateUuid } from "uuid"; dotenv.config(); -export abstract class StorageDFSTest extends PerfStressTest { +export abstract class StorageDFSTest extends PerfTest { datalakeServiceClient: DataLakeServiceClient; fileSystemClient: DataLakeFileSystemClient; directoryClient: DataLakeDirectoryClient; diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts index 45f426824138..6b386dd5b02a 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { v4 as generateUuid } from "uuid"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { DataLakeFileClient } from "@azure/storage-file-datalake"; import { StorageDFSTest } from "./storageTest.spec"; @@ -13,7 +13,7 @@ interface StorageFileShareUploadTestOptions { export class StorageDFSUploadTest extends StorageDFSTest { buffer: Buffer; fileClient: DataLakeFileClient; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/package.json b/sdk/storage/perf-tests/storage-file-share-track-1/package.json index be137e99ef96..2f02bb32a108 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/package.json +++ b/sdk/storage/perf-tests/storage-file-share-track-1/package.json @@ -9,7 +9,7 @@ "license": "ISC", "devDependencies": { "@azure/storage-file": "^10.3.0", - "@azure/test-utils-perfstress": "file:../../../test-utils/perfstress/azure-test-utils-perfstress-1.0.0.tgz", + "@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz", "@types/uuid": "^8.0.0", "@types/node": "^12.0.0", "dotenv": "^8.2.0", diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts index f55d585d8487..1fd3c5ddf3d8 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary, drainStream } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, drainStream } from "@azure/test-utils-perf"; import { Aborter, FileURL } from "@azure/storage-file"; import { StorageFileShareTest } from "./storageTest"; import { generateUuid } from "@azure/core-http"; @@ -13,7 +13,7 @@ interface StorageFileShareDownloadTestOptions { export class StorageFileShareDownloadTest extends StorageFileShareTest< StorageFileShareDownloadTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/index.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/index.spec.ts index 72e07bdb795e..547bc446dd55 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/index.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/index.spec.ts @@ -1,13 +1,13 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { StorageFileShareDownloadTest } from "./download.spec"; import { StorageFileShareUploadTest } from "./upload.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([StorageFileShareDownloadTest, StorageFileShareUploadTest]) +const perfProgram = new PerfProgram( + selectPerfTest([StorageFileShareDownloadTest, StorageFileShareUploadTest]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/storageTest.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/storageTest.ts index 85af4c849223..4572749b8398 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/storageTest.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/storageTest.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ServiceURL, ShareURL, @@ -16,7 +16,7 @@ import * as dotenv from "dotenv"; import { generateUuid } from "@azure/core-http"; dotenv.config(); -export abstract class StorageFileShareTest extends PerfStressTest { +export abstract class StorageFileShareTest extends PerfTest { shareServiceClient: ServiceURL; shareClient: ShareURL; directoryClient: DirectoryURL; diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts index ea921af7e12c..b0af193cabcb 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { Aborter, FileURL } from "@azure/storage-file"; import { StorageFileShareTest } from "./storageTest"; import { generateUuid } from "@azure/core-http"; @@ -14,7 +14,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< > { fileClient: FileURL; buffer: Buffer; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share/package.json b/sdk/storage/perf-tests/storage-file-share/package.json index 8fe0ea023119..17888a9cd111 100644 --- a/sdk/storage/perf-tests/storage-file-share/package.json +++ b/sdk/storage/perf-tests/storage-file-share/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/storage-file-share": "^12.8.1", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts index e8c3b7ede38d..8d6f827a9398 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { v4 as generateUuid } from "uuid"; -import { PerfStressOptionDictionary, drainStream } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, drainStream } from "@azure/test-utils-perf"; import { ShareFileClient } from "@azure/storage-file-share"; import { StorageFileShareTest } from "./storageTest.spec"; @@ -13,7 +13,7 @@ interface StorageFileShareDownloadTestOptions { export class StorageFileShareDownloadTest extends StorageFileShareTest< StorageFileShareDownloadTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts index e68b87d86534..53b327426dc2 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { ShareFileClient } from "@azure/storage-file-share"; import fs from "fs"; import util from "util"; @@ -20,7 +20,7 @@ const localDirName = "temp"; export class StorageFileShareDownloadToFileTest extends StorageFileShareTest< StorageFileShareDownloadTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share/test/index.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/index.spec.ts index 5a69ef5a9e80..497e6b8768bb 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/index.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/index.spec.ts @@ -1,16 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { StorageFileShareDownloadTest } from "./download.spec"; import { StorageFileShareDownloadToFileTest } from "./downloadToFile.spec"; import { StorageFileShareUploadTest } from "./upload.spec"; import { StorageFileShareUploadFromFileTest } from "./uploadFromFile.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ +const perfProgram = new PerfProgram( + selectPerfTest([ StorageFileShareDownloadTest, StorageFileShareDownloadToFileTest, StorageFileShareUploadTest, @@ -18,4 +18,4 @@ const perfStressProgram = new PerfStressProgram( ]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/storage/perf-tests/storage-file-share/test/storageTest.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/storageTest.spec.ts index 691708cdab0c..ac72475bc389 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/storageTest.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/storageTest.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ShareClient, ShareDirectoryClient, ShareServiceClient } from "@azure/storage-file-share"; @@ -10,7 +10,7 @@ import * as dotenv from "dotenv"; import { v4 as generateUuid } from "uuid"; dotenv.config(); -export abstract class StorageFileShareTest extends PerfStressTest { +export abstract class StorageFileShareTest extends PerfTest { shareServiceClient: ShareServiceClient; shareClient: ShareClient; directoryClient: ShareDirectoryClient; diff --git a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts index b97a8a6ec5dd..41b3b0410c67 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { v4 as generateUuid } from "uuid"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { ShareFileClient } from "@azure/storage-file-share"; import { StorageFileShareTest } from "./storageTest.spec"; @@ -15,7 +15,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< > { fileClient: ShareFileClient; buffer: Buffer; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts index e6de30e793da..9c298973fa9d 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { v4 as generateUuid } from "uuid"; -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import fs from "fs"; import util from "util"; import { ShareFileClient } from "@azure/storage-file-share"; @@ -23,7 +23,7 @@ export class StorageFileShareUploadFromFileTest extends StorageFileShareTest< StorageFileShareUploadFromFileTestOptions > { fileClient: ShareFileClient; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { size: { required: true, description: "Size in bytes", diff --git a/sdk/storage/storage-blob/package.json b/sdk/storage/storage-blob/package.json index 47c75b8bf5e5..0dd781087567 100644 --- a/sdk/storage/storage-blob/package.json +++ b/sdk/storage/storage-blob/package.json @@ -141,7 +141,7 @@ "@azure/identity": "2.0.0-beta.6", "@azure/test-utils": "^1.0.0", "@azure-tools/test-recorder": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-multi-entry": "^3.0.0", "@rollup/plugin-replace": "^2.2.0", diff --git a/sdk/storage/storage-blob/tsconfig.json b/sdk/storage/storage-blob/tsconfig.json index 30ee4ab31057..b72f82a1c9d2 100644 --- a/sdk/storage/storage-blob/tsconfig.json +++ b/sdk/storage/storage-blob/tsconfig.json @@ -12,7 +12,7 @@ "../storage-internal-avro/node_modules", "../storage-common/node_modules", "./samples/**", - "test/perfstress/track-1/" + "test/perf/track-1/" ], "include": [ "./src/**/*.ts", diff --git a/sdk/storage/storage-file-datalake/package.json b/sdk/storage/storage-file-datalake/package.json index b00b4aff1900..5e918757fc69 100644 --- a/sdk/storage/storage-file-datalake/package.json +++ b/sdk/storage/storage-file-datalake/package.json @@ -120,7 +120,7 @@ "@azure/identity": "2.0.0-beta.6", "@azure/test-utils": "^1.0.0", "@azure-tools/test-recorder": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-json": "^4.0.0", diff --git a/sdk/storage/storage-file-share/package.json b/sdk/storage/storage-file-share/package.json index 09befca9461e..c38ddeb64dd7 100644 --- a/sdk/storage/storage-file-share/package.json +++ b/sdk/storage/storage-file-share/package.json @@ -127,7 +127,7 @@ "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/test-utils": "^1.0.0", "@azure-tools/test-recorder": "^1.0.0", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "@microsoft/api-extractor": "^7.18.11", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-multi-entry": "^3.0.0", diff --git a/sdk/tables/perf-tests/data-tables/package.json b/sdk/tables/perf-tests/data-tables/package.json index 0ca668b94aad..7dcf010983f8 100644 --- a/sdk/tables/perf-tests/data-tables/package.json +++ b/sdk/tables/perf-tests/data-tables/package.json @@ -9,7 +9,7 @@ "license": "ISC", "dependencies": { "@azure/data-tables": "^12.1.2", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0", "uuid": "^8.3.0" }, diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts index 00b457e4b424..b108590b4957 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts @@ -1,10 +1,10 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TableEntity } from "@azure/data-tables"; import { createComplexEntity } from "./utils/createBaseEntity"; export class CreateComplexEntityTest extends TablesTest { - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super("ComplexEntityPerf"); diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts index c5a35f87e507..3894e30ce820 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TransactionAction } from "@azure/data-tables"; import { createBatch } from "./utils/createBaseEntity"; @@ -10,7 +10,7 @@ interface TablesCreateComplexEntityBatchTestOptions { export class CreateComplexEntityBatchTest extends TablesTest< TablesCreateComplexEntityBatchTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { batchSize: { defaultValue: 100, longName: "batchSize", diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts index af79ca4a6e15..2ae5b43c853a 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts @@ -1,10 +1,10 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TableEntity } from "@azure/data-tables"; import { createSimpleEntity } from "./utils/createBaseEntity"; export class CreateSimpleEntityTest extends TablesTest { - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; constructor() { super("SimpleEntityPerf"); diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts index 0c78a6a743f9..d5d25f142d63 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TransactionAction } from "@azure/data-tables"; import { createBatch } from "./utils/createBaseEntity"; @@ -10,7 +10,7 @@ interface TablesCreateSimpleEntityBatchTestOptions { export class CreateSimpleEntityBatchTest extends TablesTest< TablesCreateSimpleEntityBatchTestOptions > { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { batchSize: { defaultValue: 100, longName: "batchSize", diff --git a/sdk/tables/perf-tests/data-tables/test/index.spec.ts b/sdk/tables/perf-tests/data-tables/test/index.spec.ts index 8af21af5ade7..16ec1671af6f 100644 --- a/sdk/tables/perf-tests/data-tables/test/index.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/index.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { CreateSimpleEntityTest } from "./createSimpleEntity.spec"; import { CreateSimpleEntityBatchTest } from "./createSimpleEntityBatchTest.spec"; import { CreateComplexEntityTest } from "./createComplexEntity.spec"; @@ -11,10 +11,10 @@ import * as dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ +const perfProgram = new PerfProgram( + selectPerfTest([ CreateSimpleEntityTest, CreateSimpleEntityBatchTest, CreateComplexEntityTest, @@ -24,4 +24,4 @@ const perfStressProgram = new PerfStressProgram( ]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts index 8836db555fff..80f626f5a783 100644 --- a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TableEntityResult, TransactionAction } from "@azure/data-tables"; import { createBatch } from "./utils/createBaseEntity"; @@ -8,7 +8,7 @@ interface ListComplexEntitiesTestOptions { } export class ListComplexEntitiesTest extends TablesTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { entityCount: { defaultValue: 100, longName: "entityCount", diff --git a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts index a00c937308a0..cf90116d81af 100644 --- a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts @@ -1,4 +1,4 @@ -import { PerfStressOptionDictionary } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary } from "@azure/test-utils-perf"; import { TablesTest } from "./tables.spec"; import { TableEntityResult, TransactionAction } from "@azure/data-tables"; import { createBatch } from "./utils/createBaseEntity"; @@ -8,7 +8,7 @@ interface ListSimpleEntitiesTestOptions { } export class ListSimpleEntitiesTest extends TablesTest { - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { entityCount: { defaultValue: 100, longName: "entityCount", diff --git a/sdk/tables/perf-tests/data-tables/test/tables.spec.ts b/sdk/tables/perf-tests/data-tables/test/tables.spec.ts index af460e40b584..c78012d78425 100644 --- a/sdk/tables/perf-tests/data-tables/test/tables.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/tables.spec.ts @@ -1,8 +1,8 @@ -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { TableClient } from "@azure/data-tables"; -export abstract class TablesTest> extends PerfStressTest< +export abstract class TablesTest> extends PerfTest< TOptions > { client: TableClient; diff --git a/sdk/test-utils/perfstress/.dockerignore b/sdk/test-utils/perf/.dockerignore similarity index 100% rename from sdk/test-utils/perfstress/.dockerignore rename to sdk/test-utils/perf/.dockerignore diff --git a/sdk/test-utils/perfstress/CHANGELOG.md b/sdk/test-utils/perf/CHANGELOG.md similarity index 84% rename from sdk/test-utils/perfstress/CHANGELOG.md rename to sdk/test-utils/perf/CHANGELOG.md index 06b7266c85e9..1a2128fc8b36 100644 --- a/sdk/test-utils/perfstress/CHANGELOG.md +++ b/sdk/test-utils/perf/CHANGELOG.md @@ -21,7 +21,7 @@ ### 2021-09-24 -- Instead of using the cached proxy-clients(to leverage the proxy-tool), we now get a new client for each of the instantiated PerfStressTest classes. [#17832](https://github.com/Azure/azure-sdk-for-js/pull/17832) +- Instead of using the cached proxy-clients(to leverage the proxy-tool), we now get a new client for each of the instantiated PerfTest classes. [#17832](https://github.com/Azure/azure-sdk-for-js/pull/17832) ### 2021-09-23 @@ -39,8 +39,8 @@ ### 2021-07-14 -- Removed the run method in the `PerfStressTest` class as we only deal with the async methods when it comes to performance. +- Removed the run method in the `PerfTest` class as we only deal with the async methods when it comes to performance. ### 2020-04-22 -- Merged the first working implementation of perfstress. +- Merged the first working implementation of perf. diff --git a/sdk/test-utils/perfstress/Dockerfile b/sdk/test-utils/perf/Dockerfile similarity index 100% rename from sdk/test-utils/perfstress/Dockerfile rename to sdk/test-utils/perf/Dockerfile diff --git a/sdk/test-utils/perfstress/GettingStarted.md b/sdk/test-utils/perf/GettingStarted.md similarity index 93% rename from sdk/test-utils/perfstress/GettingStarted.md rename to sdk/test-utils/perf/GettingStarted.md index 9d47b72f7a33..64dc53d23ff0 100644 --- a/sdk/test-utils/perfstress/GettingStarted.md +++ b/sdk/test-utils/perf/GettingStarted.md @@ -40,16 +40,16 @@ To add perf tests for the `sdk//` package, follow the step 3. Tests will live under `sdk//perf-tests//test` 4. Add a `package.json` such as [example-perf-package.json](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/perf-tests/storage-file-datalake/package.json) at `sdk//perf-tests/` folder. - Make sure to import your `` and the `test-utils-perfstress` project. + Make sure to import your `` and the `test-utils-perf` project. ```json "dependencies": { "@azure/": "^", - "@azure/test-utils-perfstress": "^1.0.0" + "@azure/test-utils-perf": "^1.0.0" } ``` - _Note: `"@azure/test-utils-perfstress"` is not a published npm package._ + _Note: `"@azure/test-utils-perf"` is not a published npm package._ Set the name of the package and mark it as private. @@ -93,12 +93,12 @@ To add perf tests for the `sdk//` package, follow the step 3. Add a `package.json` such as [example-track-1-perf-package.json](https://github.com/Azure/azure-sdk-for-js/blob/fe9b1e5a50946f53b6491d7f67b2420d8ee1b229/sdk/storage/perf-tests/storage-blob-track-1/package.json) at `sdk//perf-tests/` folder. - Make sure to import your `` and the `test-utils-perfstress` project. + Make sure to import your `` and the `test-utils-perf` project. ```json "dependencies": { "@azure/": "^", - "@azure/test-utils-perfstress": "file:../../../test-utils/perfstress/azure-test-utils-perfstress-1.0.0.tgz", + "@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz", } ``` @@ -131,7 +131,7 @@ To add perf tests for the `sdk//` package, follow the step Add an `index.spec.ts` at `sdk//perf-tests//test/`. ```js -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { `ServiceNameAPI1Name`Test } from "./api1-name.spec"; import { `ServiceNameAPI2Name`Test } from "./api2-name.spec"; @@ -139,11 +139,11 @@ import { `ServiceNameAPI2Name`Test } from "./api2-name.spec"; import * as dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([`ServiceNameAPIName`Test, `ServiceNameAPIName2`Test])); +const perfProgram = new PerfProgram(selectPerfTest([`ServiceNameAPIName`Test, `ServiceNameAPIName2`Test])); -perfStressProgram.run(); +perfProgram.run(); ``` ### [Base Class](#base-class) @@ -153,12 +153,12 @@ Base class would have all the common code that would be repeated for each of the Create a new file such as `serviceName.spec.ts` at `sdk//perf-tests//test/`. ```js -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { ServiceNameClient } from "@azure/"; -export abstract class `ServiceName`Test extends PerfStressTest { +export abstract class `ServiceName`Test extends PerfTest { serviceNameClient: ServiceNameClient; constructor() { @@ -182,12 +182,12 @@ Following code shows how the individual perf test files would look like. ```js import { ServiceNameClient } from "@azure/"; -import { PerfStressOptionDictionary, drainStream } from "@azure/test-utils-perfstress"; +import { PerfOptionDictionary, drainStream } from "@azure/test-utils-perf"; import { `ServiceName`Test } from "./serviceNameTest.spec"; export class `ServiceNameAPIName`Test extends ServiceNameTest { // The next section talks about the custom options that you can provide for a test - public options: PerfStressOptionDictionary = {}; + public options: PerfOptionDictionary = {}; serviceNameClient: `ServiceName`Client; @@ -221,7 +221,7 @@ interface `ServiceNameAPIName`TestOptions { } export class `ServiceNameAPIName`Test extends ServiceNameTest<`ServiceNameAPIName`TestOptions> { - public options: PerfStressOptionDictionary<`ServiceNameAPIName`TestOptions> = { + public options: PerfOptionDictionary<`ServiceNameAPIName`TestOptions> = { newOption: { required: true, description: "A new option", diff --git a/sdk/test-utils/perfstress/LICENSE b/sdk/test-utils/perf/LICENSE similarity index 100% rename from sdk/test-utils/perfstress/LICENSE rename to sdk/test-utils/perf/LICENSE diff --git a/sdk/test-utils/perfstress/README.md b/sdk/test-utils/perf/README.md similarity index 64% rename from sdk/test-utils/perfstress/README.md rename to sdk/test-utils/perf/README.md index b9812bf4631e..2a6b26e6408d 100644 --- a/sdk/test-utils/perfstress/README.md +++ b/sdk/test-utils/perf/README.md @@ -1,18 +1,18 @@ -# Azure PerfStress library for JavaScript +# Azure Perf library for JavaScript ## Getting started -To start a new perf test project for the your SDK in the js repository, follow the steps in the [GettingStarted.md](https://github.com/Azure/azure-sdk-for-js/blob/c1c5f556a1a29d4a38019f1cc97fadb99375d6d5/sdk/test-utils/perfstress/GettingStarted.md). +To start a new perf test project for the your SDK in the js repository, follow the steps in the [GettingStarted.md](https://github.com/Azure/azure-sdk-for-js/blob/c1c5f556a1a29d4a38019f1cc97fadb99375d6d5/sdk/test-utils/perf/GettingStarted.md). Link to the wiki - [Writing-Performance-Tests](https://github.com/Azure/azure-sdk-for-js/wiki/Writing-Performance-Tests) (has the same contents as the GettingStarted docs) ## KeyConcepts -- A **PerfStressTest** test is a test that will be executed repeatedly to show both the performance of the program, and how it behaves under stress. +- A **PerfTest** test is a test that will be executed repeatedly to show both the performance of the program, and how it behaves under stress. - Tests have an asynchronous method called `runAsync` which is executed based on the duration, iterations, and parallel options provided for the perf test. More about options below. -- A **PerfStressOption** is a command line parameter. We use `minimist` to parse them appropriately, and then to consolidate them in a dictionary of options that is called `PerfStressOptionDictionary`. The dictionary class accepts a union type of strings that defines the options that are allowed by each test. -- Some default options are parsed by the PerfStress program. Their longer names are: `help`, `no-cleanups`, `parallel`, `duration`, `warmup`, `iterations`, `no-cleanup` and `milliseconds-to-log`. -- PerfStress tests are executed as many times as possible until the `duration` parameter is specified. This process may repeat as many `iterations` are given. Before each iteration, tests might be called for a period of time up to `warmup`, to adjust to possible runtime optimizations. In each iteration, as many as `parallel` instances of the same test are called without waiting for each other, letting the event loop decide which one is prioritized (it's not true parallelism, but it's an approximation that aligns with the design in other languages, we might improve it over time). +- A **PerfOption** is a command line parameter. We use `minimist` to parse them appropriately, and then to consolidate them in a dictionary of options that is called `PerfOptionDictionary`. The dictionary class accepts a union type of strings that defines the options that are allowed by each test. +- Some default options are parsed by the Perf program. Their longer names are: `help`, `no-cleanups`, `parallel`, `duration`, `warmup`, `iterations`, `no-cleanup` and `milliseconds-to-log`. +- Perf tests are executed as many times as possible until the `duration` parameter is specified. This process may repeat as many `iterations` are given. Before each iteration, tests might be called for a period of time up to `warmup`, to adjust to possible runtime optimizations. In each iteration, as many as `parallel` instances of the same test are called without waiting for each other, letting the event loop decide which one is prioritized (it's not true parallelism, but it's an approximation that aligns with the design in other languages, we might improve it over time). - Each test can have a `globalSetup` method, which is called once before the process begins, a `globalCleanup` method, which is called once after the process finishes. - Each test can have a `setup` method, which is called as many times as test instances are created (up to `parallel`), and help specify local state for each test instance. A `cleanup` method is also optional, called the same amount of times, but after finishing running the tests. - `test-proxies` url option - this option can be leveraged to avoid hitting throttling scenarios while testing the services. This option lets the requests go through proxy server(s) based on the url(s) provided, we run runAsync method once in record mode to save the requests and responses in memory and then a ton of times in playback. Workflow with the test-proxies below. @@ -43,7 +43,7 @@ Steps below constitute the workflow of a typical perf test. ## Examples -Check the [test folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/test/). +Check the [test folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/test/). ## Troubleshooting @@ -51,12 +51,12 @@ TODO ## Next steps -Check the [source](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/src/) folder and the [test folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perfstress/test/). +Check the [source](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/src/) folder and the [test folder](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/test/). -Also check the PerfStress EPIC, here: https://github.com/Azure/azure-sdk-for-js/issues/8057 +Also check the Perf EPIC, here: https://github.com/Azure/azure-sdk-for-js/issues/8057 ## Contributing If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftest-utils%2Fperfstress%2FREADME.png) +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Ftest-utils%2Fperf%2FREADME.png) diff --git a/sdk/test-utils/perf/build.ps1 b/sdk/test-utils/perf/build.ps1 new file mode 100644 index 000000000000..eb26cd9c04a4 --- /dev/null +++ b/sdk/test-utils/perf/build.ps1 @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +docker build -t azure-sdk-for-js-perf -f Dockerfile ../../../ diff --git a/sdk/test-utils/perfstress/karma.conf.js b/sdk/test-utils/perf/karma.conf.js similarity index 100% rename from sdk/test-utils/perfstress/karma.conf.js rename to sdk/test-utils/perf/karma.conf.js diff --git a/sdk/test-utils/perfstress/package.json b/sdk/test-utils/perf/package.json similarity index 94% rename from sdk/test-utils/perfstress/package.json rename to sdk/test-utils/perf/package.json index df62c99409a5..584b382dc727 100644 --- a/sdk/test-utils/perfstress/package.json +++ b/sdk/test-utils/perf/package.json @@ -1,5 +1,5 @@ { - "name": "@azure/test-utils-perfstress", + "name": "@azure/test-utils-perf", "version": "1.0.0", "sdk-type": "client", "description": "Performance and stress test framework for the Azure SDK for JavaScript and TypeScript", @@ -22,7 +22,7 @@ "integration-test:node": "node dist-esm/test/index.spec.js", "integration-test": "npm run integration-test:node && npm run integration-test:browser", "lint:fix": "eslint --no-eslintrc -c ../../.eslintrc.internal.json package.json src test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint --no-eslintrc -c ../../.eslintrc.internal.json package.json src test --ext .ts -f html -o perfstress-lintReport.html || exit 0", + "lint": "eslint --no-eslintrc -c ../../.eslintrc.internal.json package.json src test --ext .ts -f html -o perf-lintReport.html || exit 0", "pack": "npm pack 2>&1", "perf-test:node": "npm run build && node dist-esm/test/index.spec.js", "unit-test:browser": "echo skipped", @@ -55,7 +55,7 @@ "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/test-utils/perfstress/README.md", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/test-utils/perf/README.md", "sideEffects": false, "private": true, "dependencies": { diff --git a/sdk/test-utils/perf/run.ps1 b/sdk/test-utils/perf/run.ps1 new file mode 100644 index 000000000000..75a0bb9e6b56 --- /dev/null +++ b/sdk/test-utils/perf/run.ps1 @@ -0,0 +1,3 @@ +#!/usr/bin/env pwsh + +docker run -it --rm --network host system-perf-net @args diff --git a/sdk/test-utils/perfstress/runAllTests.sh b/sdk/test-utils/perf/runAllTests.sh similarity index 84% rename from sdk/test-utils/perfstress/runAllTests.sh rename to sdk/test-utils/perf/runAllTests.sh index 81652ec30bb2..1fb98710d1ef 100755 --- a/sdk/test-utils/perfstress/runAllTests.sh +++ b/sdk/test-utils/perf/runAllTests.sh @@ -10,4 +10,4 @@ npm run perf-test:node -- SetupCleanupTest --warmup 2 --duration 4 --iterations npm run perf-test:node -- Delay500ms --warmup 2 --duration 4 --iterations 2 npm run perf-test:node -- Exception --warmup 2 --duration 4 --iterations 2 npm run perf-test:node -- Exception --warmup 2 --duration 4 --iterations 2 --sync -npm run perf-test:node -- PerfStressPolicyTest --warmup 2 --duration 4 --iterations 2 --url http://my-host.com/ +npm run perf-test:node -- PerfPolicyTest --warmup 2 --duration 4 --iterations 2 --url http://my-host.com/ diff --git a/sdk/test-utils/perfstress/src/index.ts b/sdk/test-utils/perf/src/index.ts similarity index 100% rename from sdk/test-utils/perfstress/src/index.ts rename to sdk/test-utils/perf/src/index.ts diff --git a/sdk/test-utils/perfstress/src/options.ts b/sdk/test-utils/perf/src/options.ts similarity index 85% rename from sdk/test-utils/perfstress/src/options.ts rename to sdk/test-utils/perf/src/options.ts index 36bf2cfc82f9..f7a35ac49247 100644 --- a/sdk/test-utils/perfstress/src/options.ts +++ b/sdk/test-utils/perf/src/options.ts @@ -5,7 +5,7 @@ import { default as minimist, ParsedArgs as MinimistParsedArgs } from "minimist" import { isDefined } from "./utils"; /** - * The structure of a PerfStress option. They represent command line parameters. + * The structure of a Perf option. They represent command line parameters. */ export interface OptionDetails { /** @@ -21,7 +21,7 @@ export interface OptionDetails { /** * The longName represents a command line argument that is usually longer than the shortName, * and when sent through the command line, it should have two dashes `--` before the longName specified. - * Options don't need to define longName, since it will be derived from the properties PerfStressOptionDictionary. + * Options don't need to define longName, since it will be derived from the properties PerfOptionDictionary. */ longName?: string; /** @@ -43,22 +43,22 @@ export interface OptionDetails { } /** - * A group of options is called PerfStressOptionDictionary, + * A group of options is called PerfOptionDictionary, * and is shaped as a plain object to make it easier to access them. * * `keyof TOptions` provides the names of the options. This is necessary to allow TypeScript to suggest the appropriate names * for the options and parsedOptions. */ -export type PerfStressOptionDictionary = { +export type PerfOptionDictionary = { [longName in keyof TOptions]: OptionDetails; }; /** * These represent the default options the tests can assume. * - * @interface DefaultPerfStressOptions + * @interface DefaultPerfOptions */ -export interface DefaultPerfStressOptions { +export interface DefaultPerfOptions { help: string; parallel: number; duration: number; @@ -73,7 +73,7 @@ export interface DefaultPerfStressOptions { /** * These are the default options in full. */ -export const defaultPerfStressOptions: PerfStressOptionDictionary = { +export const defaultPerfOptions: PerfOptionDictionary = { help: { description: "Shows all of the available options", shortName: "h" @@ -125,14 +125,14 @@ export const defaultPerfStressOptions: PerfStressOptionDictionary( - options: PerfStressOptionDictionary -): Required> { +export function parsePerfOption( + options: PerfOptionDictionary +): Required> { const minimistResult: MinimistParsedArgs = minimist( process.argv, getBooleanOptionDetails(options) ); - const result: Partial> = {}; + const result: Partial> = {}; for (const longName of Object.keys(options)) { // This cast is needed since we're picking up options from process.argv @@ -150,7 +150,7 @@ export function parsePerfStressOption( if (required && !isDefined(value)) { throw new Error(`Option ${longName} is required`); } - // Options don't need to define longName, it can be derived from the properties PerfStressOptionDictionary. + // Options don't need to define longName, it can be derived from the properties PerfOptionDictionary. result[longName as keyof TOptions] = { ...option, longName, @@ -158,10 +158,10 @@ export function parsePerfStressOption( }; } - return result as Required>; + return result as Required>; } -function getBooleanOptionDetails(options: PerfStressOptionDictionary) { +function getBooleanOptionDetails(options: PerfOptionDictionary) { let booleanProps: { boolean: string[]; default: { [key: string]: boolean } } = { boolean: [], default: {} diff --git a/sdk/test-utils/perfstress/src/parallel.ts b/sdk/test-utils/perf/src/parallel.ts similarity index 94% rename from sdk/test-utils/perfstress/src/parallel.ts rename to sdk/test-utils/perf/src/parallel.ts index 453499e35ef1..10a88c14ba45 100644 --- a/sdk/test-utils/perfstress/src/parallel.ts +++ b/sdk/test-utils/perf/src/parallel.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. /** - * PerfStressParallel helps keep track of the total completed operations + * PerfParallel helps keep track of the total completed operations * and the last milliseconds elapsed on each parallel call. * * In languages supporting threads, "parallels" mean new threads created in which we run @@ -11,7 +11,7 @@ * promises that are executed one after the other without waiting for the previous one to finish. * We wait for all of the promises to resolve to consider the "parallel" execution finished. */ -export interface PerfStressParallel { +export interface PerfParallel { /** * Tracks the number of completed operations during a given parallel call. */ diff --git a/sdk/test-utils/perfstress/src/policy.ts b/sdk/test-utils/perf/src/policy.ts similarity index 96% rename from sdk/test-utils/perfstress/src/policy.ts rename to sdk/test-utils/perf/src/policy.ts index c259da90607b..8d7ca323d03f 100644 --- a/sdk/test-utils/perfstress/src/policy.ts +++ b/sdk/test-utils/perf/src/policy.ts @@ -12,7 +12,7 @@ import * as url from "url"; * any targeted URL. The original host is kept as a header * on the outgoing request. */ -export class PerfStressPolicy extends BaseRequestPolicy { +export class PerfPolicy extends BaseRequestPolicy { private host: string; private port?: string | null; diff --git a/sdk/test-utils/perfstress/src/program.ts b/sdk/test-utils/perf/src/program.ts similarity index 89% rename from sdk/test-utils/perfstress/src/program.ts rename to sdk/test-utils/perf/src/program.ts index fc31eec6d993..c0f29bb9b032 100644 --- a/sdk/test-utils/perfstress/src/program.ts +++ b/sdk/test-utils/perf/src/program.ts @@ -2,43 +2,43 @@ // Licensed under the MIT license. import { AbortController } from "@azure/abort-controller"; -import { PerfStressTest, PerfStressTestConstructor } from "./tests"; +import { PerfTest, PerfTestConstructor } from "./tests"; import { - PerfStressOptionDictionary, - parsePerfStressOption, - defaultPerfStressOptions, - DefaultPerfStressOptions + PerfOptionDictionary, + parsePerfOption, + defaultPerfOptions, + DefaultPerfOptions } from "./options"; -import { PerfStressParallel } from "./parallel"; +import { PerfParallel } from "./parallel"; import { TestProxyHttpClientV1, TestProxyHttpClient } from "./testProxyHttpClient"; export type TestType = ""; /** - * PerfStressProgram - * receives a class extending PerfStressTest with specific command line parameter names (or just "string"), + * PerfProgram + * receives a class extending PerfTest with specific command line parameter names (or just "string"), * then gets the test ready for a performance/stress test run. * * Use it like: * * ```ts - * export class Delay500ms extends PerfStressTest { + * export class Delay500ms extends PerfTest { * public options = {}; * async run(): Promise { * await delay(500); * } * } * - * const perfStressProgram = new PerfStressProgram(Delay500ms); + * const perfProgram = new PerfProgram(Delay500ms); * - * perfStressProgram.run(); + * perfProgram.run(); * ``` */ -export class PerfStressProgram { +export class PerfProgram { private testName: string; - private parsedDefaultOptions: Required>; + private parsedDefaultOptions: Required>; private parallelNumber: number; - private tests: PerfStressTest[]; + private tests: PerfTest[]; /** * Receives a test class to instantiate and execute. @@ -48,13 +48,13 @@ export class PerfStressProgram { * * @param testClass The testClass to be instantiated. */ - constructor(testClass: PerfStressTestConstructor) { + constructor(testClass: PerfTestConstructor) { this.testName = testClass.name; - this.parsedDefaultOptions = parsePerfStressOption(defaultPerfStressOptions); + this.parsedDefaultOptions = parsePerfOption(defaultPerfOptions); this.parallelNumber = Number(this.parsedDefaultOptions.parallel.value); console.log(`=== Creating ${this.parallelNumber} instance(s) of ${this.testName} ===`); - this.tests = new Array>(this.parallelNumber); + this.tests = new Array>(this.parallelNumber); for (let i = 0; i < this.parallelNumber; i++) { const test = new testClass(); @@ -62,11 +62,11 @@ export class PerfStressProgram { } } - private getCompletedOperations(parallels: PerfStressParallel[]): number { + private getCompletedOperations(parallels: PerfParallel[]): number { return parallels.reduce((sum, i) => sum + i.completedOperations, 0); } - private getOperationsPerSecond(parallels: PerfStressParallel[]): number { + private getOperationsPerSecond(parallels: PerfParallel[]): number { return parallels.reduce((sum, parallel) => { let parallelResult = 0; if (parallel.completedOperations > 0) { @@ -96,7 +96,7 @@ export class PerfStressProgram { * * @param parallels Parallel executions */ - private logResults(parallels: PerfStressParallel[]): void { + private logResults(parallels: PerfParallel[]): void { const totalOperations = this.getCompletedOperations(parallels); const operationsPerSecond = this.getOperationsPerSecond(parallels); const secondsPerOperation = 1 / operationsPerSecond; @@ -123,7 +123,7 @@ export class PerfStressProgram { /** * Runs the test in scope repeatedly, without waiting for any promises to finish, * as many times as possible until durationMilliseconds is reached. - * For each test run, it will report one more completedOperations on the PerfStressParallel given, + * For each test run, it will report one more completedOperations on the PerfParallel given, * as well as the lastMillisecondsElapsed that reports the last test execution's elapsed time in comparison * to the beginning of the execution of runLoop. * @@ -132,8 +132,8 @@ export class PerfStressProgram { * @param abortController Allows us to send through a signal determining when to abort any execution. */ private async runLoopAsync( - test: PerfStressTest, - parallel: PerfStressParallel, + test: PerfTest, + parallel: PerfParallel, durationMilliseconds: number, abortController: AbortController ): Promise { @@ -168,7 +168,7 @@ export class PerfStressProgram { durationSeconds: number, title: string ): Promise { - const parallels: PerfStressParallel[] = new Array(this.parallelNumber); + const parallels: PerfParallel[] = new Array(this.parallelNumber); const parallelTestResults: Array> = new Array>(this.parallelNumber); const abortController = new AbortController(); @@ -201,7 +201,7 @@ export class PerfStressProgram { const runLoop = this.runLoopAsync; - // Unhandled exceptions should stop the whole PerfStress process. + // Unhandled exceptions should stop the whole Perf process. process.on("unhandledRejection", (error) => { throw error; }); @@ -213,7 +213,7 @@ export class PerfStressProgram { // then in another loop, we wait for each one of these promises to finish. // This should allow for the event loop to decide when to process each test call. for (let i = 0; i < parallel; i++) { - const parallel: PerfStressParallel = { + const parallel: PerfParallel = { completedOperations: 0, lastMillisecondsElapsed: 0 }; @@ -253,10 +253,10 @@ export class PerfStressProgram { * until as many seconds as the "warmup" parameter says. This is to adjust * to any possible real-time optimizations that the JavaScript runtime might * do while executing something repeatedly. This is also a requirement to align with the - * PerfStress framework in other languages. + * Perf framework in other languages. * * If any exception is encountered, the whole process will stop, unless - * these exceptions are instances of the class PerfStressTestError, which defines expected errors. + * these exceptions are instances of the class PerfTestError, which defines expected errors. */ public async run(): Promise { // There should be no test execution if the help option is passed. @@ -287,7 +287,7 @@ export class PerfStressProgram { } if (this.tests[0].parsedOptions["test-proxies"].value) { - // Records requests(in runAsync method) for all the instantiated PerfStressTest classes, + // Records requests(in runAsync method) for all the instantiated PerfTest classes, // and asks the proxy-tool to start playing back for future requests. await Promise.all(this.tests.map((test) => this.recordAndStartPlayback(test))); } @@ -349,7 +349,7 @@ export class PerfStressProgram { * - making a request to the proxy server to stop playing back * - delete the live resources that we have created before */ - private async recordAndStartPlayback(test: PerfStressTest) { + private async recordAndStartPlayback(test: PerfTest) { // If test-proxy, // => then start record // => run the runAsync @@ -378,7 +378,7 @@ export class PerfStressProgram { recorder._mode = "playback"; } - private async stopPlayback(test: PerfStressTest) { + private async stopPlayback(test: PerfTest) { if (test.testProxyHttpClient) { await test.testProxyHttpClient.stopPlayback(); } else if (test.testProxyHttpClientV1) { diff --git a/sdk/test-utils/perfstress/src/testProxyHttpClient.ts b/sdk/test-utils/perf/src/testProxyHttpClient.ts similarity index 100% rename from sdk/test-utils/perfstress/src/testProxyHttpClient.ts rename to sdk/test-utils/perf/src/testProxyHttpClient.ts diff --git a/sdk/test-utils/perfstress/src/tests.ts b/sdk/test-utils/perf/src/tests.ts similarity index 75% rename from sdk/test-utils/perfstress/src/tests.ts rename to sdk/test-utils/perf/src/tests.ts index fe5c97ccd11a..5c60f4f254bb 100644 --- a/sdk/test-utils/perfstress/src/tests.ts +++ b/sdk/test-utils/perf/src/tests.ts @@ -4,10 +4,10 @@ import { AbortSignalLike } from "@azure/abort-controller"; import { default as minimist, ParsedArgs as MinimistParsedArgs } from "minimist"; import { - PerfStressOptionDictionary, - parsePerfStressOption, - DefaultPerfStressOptions, - defaultPerfStressOptions + PerfOptionDictionary, + parsePerfOption, + DefaultPerfOptions, + defaultPerfOptions } from "./options"; import { TestProxyHttpClient, @@ -18,33 +18,33 @@ import { HttpClient } from "@azure/core-http"; import { Pipeline } from "@azure/core-rest-pipeline"; /** - * Defines the behavior of the PerfStressTest constructor, to use the class as a value. + * Defines the behavior of the PerfTest constructor, to use the class as a value. */ -export interface PerfStressTestConstructor { - new (): PerfStressTest; +export interface PerfTestConstructor { + new (): PerfTest; } /** - * Conveys the structure of any PerfStress test. + * Conveys the structure of any Perf test. * It allows developers to define the optional parameters to receive * in a way that aids them to auto-complete these options while adding code inside of each method. * It provides methods to parse the assigned options, as well as to set up and tear down any resources - * at a global level (only one setup and teardown for the whole execution of a PerfStress test), + * at a global level (only one setup and teardown for the whole execution of a Perf test), * and at a local level, which happens once for each initialization of the test class * (initializations are as many as the "parallel" command line parameter specifies). */ -export abstract class PerfStressTest { +export abstract class PerfTest { private readonly testProxy!: string; public testProxyHttpClient!: TestProxyHttpClient; public testProxyHttpClientV1!: TestProxyHttpClientV1; - public abstract options: PerfStressOptionDictionary; + public abstract options: PerfOptionDictionary; private static globalParallelIndex: number = 0; protected readonly parallelIndex: number; public constructor() { - this.parallelIndex = PerfStressTest.globalParallelIndex; - PerfStressTest.globalParallelIndex++; + this.parallelIndex = PerfTest.globalParallelIndex; + PerfTest.globalParallelIndex++; const testProxies = this.parsedOptions["test-proxies"].value; if (testProxies) { @@ -53,15 +53,15 @@ export abstract class PerfStressTest { } } - public get parsedOptions(): PerfStressOptionDictionary { + public get parsedOptions(): PerfOptionDictionary { // This cast is needed because TS thinks - // PerfStressOptionDictionary + // PerfOptionDictionary // is different from - // PerfStressOptionDictionary & PerfStressOptionDictionary - return parsePerfStressOption({ + // PerfOptionDictionary & PerfOptionDictionary + return parsePerfOption({ ...this.options, - ...defaultPerfStressOptions - }) as PerfStressOptionDictionary; + ...defaultPerfOptions + }) as PerfOptionDictionary; } // Before and after running a bunch of the same test. @@ -120,12 +120,12 @@ export abstract class PerfStressTest { /** * Picks a specific test case by comparing the first command line paramter to the names of the - * given classes, all of which must extend PerfStressTest. - * @param tests An array of classes that extend PerfStressTest + * given classes, all of which must extend PerfTest. + * @param tests An array of classes that extend PerfTest */ -export function selectPerfStressTest( - tests: PerfStressTestConstructor[] -): PerfStressTestConstructor { +export function selectPerfTest( + tests: PerfTestConstructor[] +): PerfTestConstructor { const testsNames: string[] = tests.map((test) => test.name); const minimistResult: MinimistParsedArgs = minimist(process.argv); const testName = minimistResult._[minimistResult._.length - 1]; diff --git a/sdk/test-utils/perfstress/src/utils.ts b/sdk/test-utils/perf/src/utils.ts similarity index 100% rename from sdk/test-utils/perfstress/src/utils.ts rename to sdk/test-utils/perf/src/utils.ts diff --git a/sdk/test-utils/perfstress/test/delay.spec.ts b/sdk/test-utils/perf/test/delay.spec.ts similarity index 89% rename from sdk/test-utils/perfstress/test/delay.spec.ts rename to sdk/test-utils/perf/test/delay.spec.ts index 5ef8484cea69..a7d1769baec1 100644 --- a/sdk/test-utils/perfstress/test/delay.spec.ts +++ b/sdk/test-utils/perf/test/delay.spec.ts @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest } from "../src"; +import { PerfTest } from "../src"; import { delay } from "@azure/core-http"; /** * Delay500ms waits for 500 milliseconds on every test call, - * which helps track how the PerfStress framework works internally. + * which helps track how the Perf framework works internally. * * Let's say this test is executed with the following parameters: * `--duration 4 --iterations 2`, then this test should be executed twice every 500ms, until 4 seconds are reached. @@ -32,7 +32,7 @@ import { delay } from "@azure/core-http"; * Completed 8 operations in a weighted-average of 4.00s (2.00 ops/s 0.501 s/op) * ``` */ -export class Delay500ms extends PerfStressTest { +export class Delay500ms extends PerfTest { /** * This test doesn't receive command line parameters. */ diff --git a/sdk/test-utils/perfstress/test/exception.spec.ts b/sdk/test-utils/perf/test/exception.spec.ts similarity index 74% rename from sdk/test-utils/perfstress/test/exception.spec.ts rename to sdk/test-utils/perf/test/exception.spec.ts index 38f9351dade9..dccf37cd1566 100644 --- a/sdk/test-utils/perfstress/test/exception.spec.ts +++ b/sdk/test-utils/perf/test/exception.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest } from "../src"; +import { PerfTest } from "../src"; /** - * Exception is designed to test the response speed of the PerfStress test framework + * Exception is designed to test the response speed of the Perf test framework * If the option "sync" is passed, errors will be thrown on every test call, where the test being called is simple function. * Otherwise, errors thrown on every test call, where the test being called is a function returning a promise (an asynchronous function). */ -export class Exception extends PerfStressTest { +export class Exception extends PerfTest { public options = {}; async runAsync(): Promise { diff --git a/sdk/test-utils/perfstress/test/index.spec.ts b/sdk/test-utils/perf/test/index.spec.ts similarity index 66% rename from sdk/test-utils/perfstress/test/index.spec.ts rename to sdk/test-utils/perf/test/index.spec.ts index d9bfd7df2840..8d5f5d331533 100644 --- a/sdk/test-utils/perfstress/test/index.spec.ts +++ b/sdk/test-utils/perf/test/index.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "../src"; +import { PerfProgram, selectPerfTest } from "../src"; // Tests: import { NoOp } from "./noop.spec"; @@ -9,25 +9,25 @@ import { OptionsTest } from "./options.spec"; import { SetupCleanupTest } from "./setupCleanup.spec"; import { Delay500ms } from "./delay.spec"; import { Exception } from "./exception.spec"; -import { PerfStressPolicyTest } from "./perfStressPolicy.spec"; +import { PerfPolicyTest } from "./perfPolicy.spec"; import { SleepTest } from "./sleep.spec"; import { NodeFetchTest } from "./nodeFetch.spec"; import { ServiceClientGetTest } from "./serviceClientGet.spec"; -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram( - selectPerfStressTest([ +const perfProgram = new PerfProgram( + selectPerfTest([ NoOp, OptionsTest, SetupCleanupTest, Delay500ms, Exception, - PerfStressPolicyTest, + PerfPolicyTest, SleepTest, NodeFetchTest, ServiceClientGetTest ]) ); -perfStressProgram.run(); +perfProgram.run(); diff --git a/sdk/test-utils/perfstress/test/nodeFetch.spec.ts b/sdk/test-utils/perf/test/nodeFetch.spec.ts similarity index 77% rename from sdk/test-utils/perfstress/test/nodeFetch.spec.ts rename to sdk/test-utils/perf/test/nodeFetch.spec.ts index 55fd91a57437..26d62cf48017 100644 --- a/sdk/test-utils/perfstress/test/nodeFetch.spec.ts +++ b/sdk/test-utils/perf/test/nodeFetch.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, PerfStressOptionDictionary } from "../src"; +import { PerfTest, PerfOptionDictionary } from "../src"; import fetch from "node-fetch"; import * as http from "http"; @@ -10,14 +10,14 @@ interface NodeFetchOptions { url: string; } -export class NodeFetchTest extends PerfStressTest { +export class NodeFetchTest extends PerfTest { private static fetchOptions = { agent: new http.Agent({ keepAlive: true }) }; private url: string = ""; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { url: { required: true, description: "Required option", diff --git a/sdk/test-utils/perf/test/noop.spec.ts b/sdk/test-utils/perf/test/noop.spec.ts new file mode 100644 index 000000000000..0fb963ccdb22 --- /dev/null +++ b/sdk/test-utils/perf/test/noop.spec.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PerfTest } from "../src"; + +/** + * Should test the raw performance impact of the Perf framework for both synchronous and asynchronous tests. + */ +export class NoOp extends PerfTest { + public options = {}; + + async runAsync(): Promise {} +} diff --git a/sdk/test-utils/perfstress/test/options.spec.ts b/sdk/test-utils/perf/test/options.spec.ts similarity index 90% rename from sdk/test-utils/perfstress/test/options.spec.ts rename to sdk/test-utils/perf/test/options.spec.ts index 3c8c913d414e..8729283dcb5d 100644 --- a/sdk/test-utils/perfstress/test/options.spec.ts +++ b/sdk/test-utils/perf/test/options.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { default as minimist, ParsedArgs as MinimistParsedArgs } from "minimist"; -import { PerfStressTest, PerfStressOptionDictionary } from "../src"; +import { PerfTest, PerfOptionDictionary } from "../src"; interface OptionsTestOptions { "non-req": string; @@ -14,10 +14,10 @@ interface OptionsTestOptions { } /** - * Showcases and verifies some of the expected behaviors of the PerfStress options + * Showcases and verifies some of the expected behaviors of the Perf options */ -export class OptionsTest extends PerfStressTest { - public options: PerfStressOptionDictionary = { +export class OptionsTest extends PerfTest { + public options: PerfOptionDictionary = { "non-req": { description: "Non-required option" }, diff --git a/sdk/test-utils/perfstress/test/perfStressPolicy.spec.ts b/sdk/test-utils/perf/test/perfPolicy.spec.ts similarity index 81% rename from sdk/test-utils/perfstress/test/perfStressPolicy.spec.ts rename to sdk/test-utils/perf/test/perfPolicy.spec.ts index 7b26c254d096..f023f988f092 100644 --- a/sdk/test-utils/perfstress/test/perfStressPolicy.spec.ts +++ b/sdk/test-utils/perf/test/perfPolicy.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import * as url from "url"; -import { PerfStressTest, PerfStressOptionDictionary, PerfStressPolicy } from "../src"; +import { PerfTest, PerfOptionDictionary, PerfPolicy } from "../src"; import { WebResource, HttpOperationResponse, @@ -10,7 +10,7 @@ import { RequestPolicyOptions } from "@azure/core-http"; -interface PerfStressPolicyOptions { +interface PerfPolicyOptions { url: string; } @@ -21,11 +21,11 @@ const defaultResponse = { }; /** - * Tests the behavior of the PerfStressPolicy. + * Tests the behavior of the PerfPolicy. * Similar to the tests available in the core-http package of the default policies provided. */ -export class PerfStressPolicyTest extends PerfStressTest { - public options: PerfStressOptionDictionary = { +export class PerfPolicyTest extends PerfTest { + public options: PerfOptionDictionary = { url: { required: true, description: "URL that will replace any request's original targeted URL", @@ -58,7 +58,7 @@ export class PerfStressPolicyTest extends PerfStressTest { +export class ServiceClientGetTest extends PerfTest { client: ServiceClient; request: PipelineRequest; firstRun: boolean = true; - public options: PerfStressOptionDictionary = { + public options: PerfOptionDictionary = { "first-run-extra-requests": { description: "Extra requests to send on first run. " + diff --git a/sdk/test-utils/perfstress/test/setupCleanup.spec.ts b/sdk/test-utils/perf/test/setupCleanup.spec.ts similarity index 84% rename from sdk/test-utils/perfstress/test/setupCleanup.spec.ts rename to sdk/test-utils/perf/test/setupCleanup.spec.ts index c404cd3082a6..1c5949cbba01 100644 --- a/sdk/test-utils/perfstress/test/setupCleanup.spec.ts +++ b/sdk/test-utils/perf/test/setupCleanup.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, PerfStressOptionDictionary } from "../src"; +import { PerfTest, PerfOptionDictionary } from "../src"; /** * Showcases and verifies some of the expected behaviors of the setup, globalSetup, cleanup and globalCleanup methods - * of the PerfStressTest class. + * of the PerfTest class. */ -export class SetupCleanupTest extends PerfStressTest { - public options: PerfStressOptionDictionary = {}; +export class SetupCleanupTest extends PerfTest { + public options: PerfOptionDictionary = {}; public state = { globalSetup: 0, diff --git a/sdk/test-utils/perfstress/test/sleep.spec.ts b/sdk/test-utils/perf/test/sleep.spec.ts similarity index 90% rename from sdk/test-utils/perfstress/test/sleep.spec.ts rename to sdk/test-utils/perf/test/sleep.spec.ts index 042a1a373799..b9cf02cadb94 100644 --- a/sdk/test-utils/perfstress/test/sleep.spec.ts +++ b/sdk/test-utils/perf/test/sleep.spec.ts @@ -1,11 +1,11 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest } from "../src"; +import { PerfTest } from "../src"; import { delay } from "@azure/core-http"; // Used for verifying the perf framework correctly computes average throughput across parallel tests of different speed -export class SleepTest extends PerfStressTest { +export class SleepTest extends PerfTest { private static instanceCount: number = 0; private secondsPerOperation: number = 0; diff --git a/sdk/test-utils/perfstress/tsconfig.json b/sdk/test-utils/perf/tsconfig.json similarity index 100% rename from sdk/test-utils/perfstress/tsconfig.json rename to sdk/test-utils/perf/tsconfig.json diff --git a/sdk/test-utils/perfstress/build.ps1 b/sdk/test-utils/perfstress/build.ps1 deleted file mode 100644 index 4ff59bf4cb0d..000000000000 --- a/sdk/test-utils/perfstress/build.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -docker build -t azure-sdk-for-js-perfstress -f Dockerfile ../../../ diff --git a/sdk/test-utils/perfstress/run.ps1 b/sdk/test-utils/perfstress/run.ps1 deleted file mode 100644 index b44d93a97eec..000000000000 --- a/sdk/test-utils/perfstress/run.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env pwsh - -docker run -it --rm --network host system-perfstress-net @args diff --git a/sdk/test-utils/perfstress/test/noop.spec.ts b/sdk/test-utils/perfstress/test/noop.spec.ts deleted file mode 100644 index a3f525094c79..000000000000 --- a/sdk/test-utils/perfstress/test/noop.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { PerfStressTest } from "../src"; - -/** - * Should test the raw performance impact of the PerfStress framework for both synchronous and asynchronous tests. - */ -export class NoOp extends PerfStressTest { - public options = {}; - - async runAsync(): Promise {} -} diff --git a/sdk/textanalytics/perf-tests/text-analytics/package.json b/sdk/textanalytics/perf-tests/text-analytics/package.json index 874bed07a4e2..d2ea70e9386a 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/package.json +++ b/sdk/textanalytics/perf-tests/text-analytics/package.json @@ -10,7 +10,7 @@ "dependencies": { "@azure/ai-text-analytics": "^5.1.0-beta.5", "@azure/identity": "2.0.0-beta.6", - "@azure/test-utils-perfstress": "^1.0.0", + "@azure/test-utils-perf": "^1.0.0", "dotenv": "^8.2.0" }, "devDependencies": { diff --git a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts index 94f5c917dc8c..e8cd7f484481 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts +++ b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts @@ -2,10 +2,10 @@ // Licensed under the MIT license. import { - PerfStressTest, - PerfStressOptionDictionary, + PerfTest, + PerfOptionDictionary, getEnvVar -} from "@azure/test-utils-perfstress"; +} from "@azure/test-utils-perf"; import { AzureKeyCredential, TextAnalyticsClient, @@ -17,8 +17,8 @@ interface DetectLanguagePerfTestOptions extends DetectLanguageOptions { "documents-count": number; } -export class DetectLanguageTest extends PerfStressTest { - options: PerfStressOptionDictionary = { +export class DetectLanguageTest extends PerfTest { + options: PerfOptionDictionary = { "documents-count": { required: true, description: "Number of documents", diff --git a/sdk/textanalytics/perf-tests/text-analytics/test/index.spec.ts b/sdk/textanalytics/perf-tests/text-analytics/test/index.spec.ts index f6340de26cc2..216fb0bbd7dd 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/test/index.spec.ts +++ b/sdk/textanalytics/perf-tests/text-analytics/test/index.spec.ts @@ -1,14 +1,14 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { PerfProgram, selectPerfTest } from "@azure/test-utils-perf"; import { DetectLanguageTest } from "./detectLanguage.spec"; import dotenv from "dotenv"; dotenv.config(); -console.log("=== Starting the perfStress test ==="); +console.log("=== Starting the perf test ==="); -const perfStressProgram = new PerfStressProgram(selectPerfStressTest([DetectLanguageTest])); +const perfProgram = new PerfProgram(selectPerfTest([DetectLanguageTest])); -perfStressProgram.run(); +perfProgram.run(); From 2e806adf2986e6a1ee303ac1a2a97d139689aa29 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 20 Oct 2021 10:40:21 -0700 Subject: [PATCH 2/8] [Perf Framework] rename runAsync method to run (#18033) --- .../test/listSettings.spec.ts | 2 +- .../test/listArtifacts.spec.ts | 2 +- .../test/listRepositories.spec.ts | 2 +- .../wwwChallenge.spec.ts | 2 +- .../eventgrid/test/sendCloudEvents.spec.ts | 2 +- .../event-hubs-track-1/test/send.spec.ts | 2 +- .../perf-tests/event-hubs/test/send.spec.ts | 2 +- .../ai-form-recognizer/test/custom.spec.ts | 2 +- .../persistence.spec.ts | 2 +- .../test/getCertificate.spec.ts | 2 +- .../test/cryptography/decrypt.spec.ts | 2 +- .../test/cryptography/sign.spec.ts | 2 +- .../test/cryptography/unwrapKey.spec.ts | 2 +- .../keyvault-keys/test/keys/get.spec.ts | 2 +- .../keyvault-secrets/test/getSecret.spec.ts | 2 +- .../keyvault-secrets/test/listSecrets.spec.ts | 2 +- .../test/listAnomalies.spec.ts | 2 +- .../test/listIncidents.spec.ts | 2 +- .../test/rootCauses.spec.ts | 2 +- .../monitor-query/test/logQuery.spec.ts | 2 +- .../monitor-query/test/logQueryBatch.spec.ts | 2 +- .../monitor-query/test/metricQuery.spec.ts | 2 +- .../test/autoCompleteTest.spec.ts | 2 +- .../test/indexDocumentsTest.spec.ts | 2 +- .../test/searchDocumentsTest.spec.ts | 2 +- .../search-documents/test/suggestTest.spec.ts | 2 +- .../test/sendBatch.spec.ts | 2 +- .../service-bus/test/sendBatch.spec.ts | 2 +- .../test/download.spec.ts | 2 +- .../test/listBlobs.spec.ts | 2 +- .../storage-blob-track-1/test/upload.spec.ts | 2 +- .../storage-blob/test/core-http.spec.ts | 2 +- .../test/core-rest-pipeline.spec.ts | 2 +- .../storage-blob/test/dowloadWithSAS.spec.ts | 2 +- .../storage-blob/test/download.spec.ts | 2 +- .../storage-blob/test/listBlobs.spec.ts | 2 +- .../storage-blob/test/node-fetch.spec.ts | 2 +- .../storage-blob/test/upload.spec.ts | 2 +- .../storage-blob/test/uploadFromFile.spec.ts | 2 +- .../storage-file-datalake/test/append.spec.ts | 2 +- .../storage-file-datalake/test/read.spec.ts | 2 +- .../storage-file-datalake/test/upload.spec.ts | 2 +- .../test/uploadFromFile.spec.ts | 2 +- .../test/download.spec.ts | 2 +- .../test/upload.spec.ts | 2 +- .../storage-file-share/test/download.spec.ts | 2 +- .../test/downloadToFile.spec.ts | 2 +- .../storage-file-share/test/upload.spec.ts | 2 +- .../test/uploadFromFile.spec.ts | 2 +- .../test/createComplexEntity.spec.ts | 2 +- .../test/createComplexEntityBatchTest.spec.ts | 2 +- .../test/createSimpleEntity.spec.ts | 2 +- .../test/createSimpleEntityBatchTest.spec.ts | 2 +- .../test/listComplexEntities.spec.ts | 2 +- .../test/listSimpleEntities.spec.ts | 2 +- sdk/test-utils/perf/GettingStarted.md | 6 ++--- sdk/test-utils/perf/README.md | 12 +++++----- sdk/test-utils/perf/src/program.ts | 24 +++++++++---------- .../perf/src/testProxyHttpClient.ts | 2 +- sdk/test-utils/perf/src/tests.ts | 2 +- sdk/test-utils/perf/test/delay.spec.ts | 2 +- sdk/test-utils/perf/test/exception.spec.ts | 2 +- sdk/test-utils/perf/test/nodeFetch.spec.ts | 2 +- sdk/test-utils/perf/test/noop.spec.ts | 2 +- sdk/test-utils/perf/test/options.spec.ts | 2 +- sdk/test-utils/perf/test/perfPolicy.spec.ts | 2 +- .../perf/test/serviceClientGet.spec.ts | 2 +- sdk/test-utils/perf/test/setupCleanup.spec.ts | 2 +- sdk/test-utils/perf/test/sleep.spec.ts | 2 +- .../test/detectLanguage.spec.ts | 2 +- 70 files changed, 88 insertions(+), 88 deletions(-) diff --git a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts index 520039664243..c9daf65ff4dd 100644 --- a/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts +++ b/sdk/appconfiguration/perf-tests/app-configuration/test/listSettings.spec.ts @@ -39,7 +39,7 @@ export class ListSettingsTest extends AppConfigTest { ); } - async runAsync(): Promise { + async run(): Promise { for await (const response of this.client .listConfigurationSettings({ keyFilter: ListSettingsTest.prefix + "*" }) .byPage()) { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts index f7af781734eb..61cd8fa4275e 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listArtifacts.spec.ts @@ -12,7 +12,7 @@ export class ArtifactListTest extends ContainerRegistryTest { + async run(): Promise { const listIterator = this.repository.listManifestProperties(); for await (const manifest of listIterator) { diff --git a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts index 727168526767..c73125d537e3 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/listRepositories.spec.ts @@ -9,7 +9,7 @@ export class RepositoryListTest extends ContainerRegistryTest { + async run(): Promise { const listIterator = this.client.listRepositoryNames(); // eslint-disable-next-line no-empty diff --git a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts index 1139109baf0c..7e9708b6cb1f 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts +++ b/sdk/core/perf-tests/core-rest-pipeline/test/bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.ts @@ -193,7 +193,7 @@ export class BearerTokenAuthenticationPolicyChallengeTest extends PerfTest { }; } - async runAsync(): Promise { + async run(): Promise { const { pipeline, testHttpsClient, request } = BearerTokenAuthenticationPolicyChallengeTest; await pipeline!.sendRequest(testHttpsClient!, request!); } diff --git a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts index b8a2b4208c28..707fb06c1c5c 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts +++ b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts @@ -47,7 +47,7 @@ export class SendCloudEventsTest extends PerfTest { + async run(): Promise { await this.client.send(this.events); } } diff --git a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts index b37440f4af4c..76e630eb92a9 100644 --- a/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs-track-1/test/send.spec.ts @@ -53,7 +53,7 @@ export class SendTest extends PerfTest { await this.producer.close(); } - async runAsync(): Promise { + async run(): Promise { await this.producer.sendBatch(this.eventBatch); } } diff --git a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts index 64a4b7b1f99e..e9147d1d8bfa 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts @@ -54,7 +54,7 @@ export class SendTest extends PerfTest { await this.producer.close(); } - async runAsync(): Promise { + async run(): Promise { await this.producer.sendBatch(this.eventBatch); } } diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts index 8d3cb6556ece..b0e50ba72e44 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts @@ -83,7 +83,7 @@ export class CustomModelRecognitionTest extends PerfTest { + async run(): Promise { const modelId = CustomModelRecognitionTest.sessionModel?.modelId; if (!modelId) { return unreachable("Failed to initialize model."); diff --git a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts index c35b73c07acc..14e135c25473 100644 --- a/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts +++ b/sdk/identity/perf-tests/identity/test/ClientSecretCredential/persistence.spec.ts @@ -34,7 +34,7 @@ export class ClientSecretCredentialPersistenceTest extends PerfTest { ClientSecretCredentialPersistenceTest.credential = credential; } - async runAsync(): Promise { + async run(): Promise { await ClientSecretCredentialPersistenceTest.credential.getToken(scope); } } diff --git a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts index 383421e0fdfe..fbe7a097d38b 100644 --- a/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-certificates/test/getCertificate.spec.ts @@ -35,7 +35,7 @@ export abstract class CertificateTest extends PerfTest { export class GetCertificateTest extends CertificateTest { public options = {}; - async runAsync(): Promise { + async run(): Promise { await this.certificateClient.getCertificate(CertificateTest.certificateName); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts index 64e53f501282..2554e1a82d06 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/decrypt.spec.ts @@ -14,7 +14,7 @@ export class DecryptTest extends CryptographyTest { this.cipherText = encryptResult.result!; } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.decrypt({ algorithm: this.algorithm, ciphertext: this.cipherText! diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts index 2e881feddaaf..c6e04368a34b 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/sign.spec.ts @@ -11,7 +11,7 @@ export class SignTest extends CryptographyTest { .digest(); } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.sign("RS256", this.digest!); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts index a2548afe7ec7..8e395cafc2bc 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/cryptography/unwrapKey.spec.ts @@ -14,7 +14,7 @@ export class UnwrapKeyTest extends CryptographyTest { this.encryptedKey = wrapResult.result; } - async runAsync(): Promise { + async run(): Promise { await CryptographyTest.cryptoClient!.unwrapKey(this.wrapAlgorithm, this.encryptedKey!); } } diff --git a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts index 982840fc27db..756632d58b55 100644 --- a/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-keys/test/keys/get.spec.ts @@ -43,7 +43,7 @@ export abstract class KeyTest extends PerfTest { } export class GetKeyTest extends KeyTest { - async runAsync(): Promise { + async run(): Promise { await this.keyClient.getKey(KeyTest.keyName); } } diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts index 66930cd201f6..b98b1c9dd805 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/getSecret.spec.ts @@ -10,7 +10,7 @@ export class GetSecretTest extends SecretTest { await this.secretClient.setSecret(GetSecretTest.secretName, "value"); } - async runAsync(): Promise { + async run(): Promise { await this.secretClient.getSecret(GetSecretTest.secretName); } diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts index a2d691b25ac9..6b76afa13ead 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/listSecrets.spec.ts @@ -40,7 +40,7 @@ export class ListSecretsTest extends SecretTest { await Promise.all(secretToCreate); } - async runAsync(): Promise { + async run(): Promise { // eslint-disable-next-line no-empty for await (const _secret of this.secretClient.listPropertiesOfSecrets()) { } diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts index 20c36482c1ed..f0960f358128 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listAnomalies.spec.ts @@ -14,7 +14,7 @@ export class AnomaliesListTest extends MetricsAdvisorTest { + async run(): Promise { const listIterator = this.client.listAnomalies({ alertConfigId: this.alertConfigId, id: this.alertId diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts index 07fca2b61680..9715f15778a6 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/listIncidents.spec.ts @@ -14,7 +14,7 @@ export class IncidentsListTest extends MetricsAdvisorTest { + async run(): Promise { const listIterator = this.client.listIncidents({ alertConfigId: this.alertConfigId, id: this.alertId diff --git a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts index ae1069e5f046..06fd88aaf736 100644 --- a/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts +++ b/sdk/metricsadvisor/perf-tests/ai-metrics-advisor/test/rootCauses.spec.ts @@ -14,7 +14,7 @@ export class RootCauseTest extends MetricsAdvisorTest this.incidentId = getEnvVar("METRICS_ADVISOR_INCIDENT_ID"); } - async runAsync(): Promise { + async run(): Promise { const result = await this.client.getIncidentRootCauses(this.detectionConfigId, this.incidentId); // eslint-disable-next-line no-empty for (const _rootcause of result.rootCauses) { diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts index 439e671aea51..67567362d02d 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts @@ -16,7 +16,7 @@ export class LogQueryTest extends MonitorQueryLog { "AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId"; } - async runAsync(): Promise { + async run(): Promise { await this.client.queryWorkspace(this.workspaceId, this.query, { startTime: new Date("2021-07-25"), endTime: new Date("2021-07-26") diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts index 025bbd2d0566..e6efd987e1aa 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts @@ -34,7 +34,7 @@ export class LogQueryBatchTest extends MonitorQueryLog ]; } - async runAsync(): Promise { + async run(): Promise { await this.client.queryBatch(this.queryBatch); } } diff --git a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts index d1e1a20edfba..8937f67141c7 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -18,7 +18,7 @@ export class MetricsQueryTest extends MonitorQueryMetrics { + async run(): Promise { await this.client.queryResource(this.metricsUri, this.metricNames, { aggregations: this.aggregations }); diff --git a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts index 5c00ba06cc46..3aeb51c9475e 100644 --- a/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/autoCompleteTest.spec.ts @@ -21,7 +21,7 @@ export class AutoCompleteTest extends SearchDocumentsBase { + async run(): Promise { await this.searchClient.autocomplete("historic", this.suggesterName); } } diff --git a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts index 84f5d5524b8c..963f936b6f2b 100644 --- a/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/indexDocumentsTest.spec.ts @@ -21,7 +21,7 @@ export class IndexDocumentsTest extends SearchDocumentsBase { + async run(): Promise { for (let i = 0; i < this.hotels.length; i++) { this.hotels[i].hotelId = Math.floor( Math.random() * (this.hotels.length * 2 - this.hotels.length + 1) + this.hotels.length diff --git a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts index 371dfba92ed2..5b4c6d384be6 100644 --- a/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/searchDocumentsTest.spec.ts @@ -21,7 +21,7 @@ export class SearchDocumentsTest extends SearchDocumentsBase { + async run(): Promise { await this.searchClient.search(""); } } diff --git a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts index fc3663c13367..4a0c2f5fe9a8 100644 --- a/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/suggestTest.spec.ts @@ -21,7 +21,7 @@ export class SuggestTest extends SearchDocumentsBase await super.populateIndex(this.parsedOptions.documentsCount.value!); } - async runAsync(): Promise { + async run(): Promise { await this.searchClient.suggest("historic", this.suggesterName); } } diff --git a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts index 23cf13cb86b5..9137761ea901 100644 --- a/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus-track-1/test/sendBatch.spec.ts @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest { this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage); } - async runAsync(): Promise { + async run(): Promise { await BatchSendTest.sender.sendBatch(this.batch); } } diff --git a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts index af512d53b85f..f2dc713df5c6 100644 --- a/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts +++ b/sdk/servicebus/perf-tests/service-bus/test/sendBatch.spec.ts @@ -38,7 +38,7 @@ export class BatchSendTest extends ServiceBusTest { this.batch = new Array(this.parsedOptions.numberOfMessages.value!).fill(sbMessage); } - async runAsync(): Promise { + async run(): Promise { await BatchSendTest.sender.sendMessages(this.batch); } } diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts index 56935ff8613c..39a4c9606c88 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/download.spec.ts @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest { + async run(): Promise { const downloadResponse = await this.blockBlobClient.download(Aborter.none, 0); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts index 39e5ab1871a7..bf662da7f20d 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/listBlobs.spec.ts @@ -31,7 +31,7 @@ export class StorageBlobListTest extends StorageBlobTest { + async run(): Promise { // List blobs let marker = undefined; do { diff --git a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts index 95ca85734415..c0dfe19d7c27 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob-track-1/test/upload.spec.ts @@ -30,7 +30,7 @@ export class StorageBlobUploadTest extends StorageBlobTest { + async run(): Promise { await this.blockBlobClient.upload(Aborter.none, this.buffer, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts index aff17f7431b6..a565f1171e7b 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-http.spec.ts @@ -28,7 +28,7 @@ export class CoreHTTPDownloadWithSASTest extends StorageBlobDownloadWithSASTest ); } - async runAsync(): Promise { + async run(): Promise { const response = await this.client.sendRequest(this.webResource); await drainStream(response.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts index 3de80a43f516..66b3c7015547 100644 --- a/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/core-rest-pipeline.spec.ts @@ -22,7 +22,7 @@ export class CoreHTTPSDownloadWithSASTest extends StorageBlobDownloadWithSASTest }); } - async runAsync(): Promise { + async run(): Promise { const response = await this.client.sendRequest(this.request); await drainStream(response.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts index baf44414e03d..77efa2f9e380 100644 --- a/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/dowloadWithSAS.spec.ts @@ -70,7 +70,7 @@ export class StorageBlobDownloadWithSASTest extends StorageBlobTest< ); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.blobClientFromSAS.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts index 3070850babe9..731246665c9c 100644 --- a/sdk/storage/perf-tests/storage-blob/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/download.spec.ts @@ -41,7 +41,7 @@ export class StorageBlobDownloadTest extends StorageBlobTest { + async run(): Promise { const downloadResponse = await this.blockBlobClient.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts index c157f109d070..85e725a73326 100644 --- a/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/listBlobs.spec.ts @@ -29,7 +29,7 @@ export class StorageBlobListTest extends StorageBlobTest { + async run(): Promise { for await (const segmentResponse of this.containerClient.listBlobsFlat().byPage()) { // eslint-disable-next-line no-empty for (const _ of segmentResponse.segment.blobItems) { diff --git a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts index a65ac155cfb3..401df7fafa75 100644 --- a/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/node-fetch.spec.ts @@ -12,7 +12,7 @@ export class NodeFetchDownloadWithSASTest extends StorageBlobDownloadWithSASTest this.agent = new https.Agent({ keepAlive: true }); } - async runAsync(): Promise { + async run(): Promise { const response = await node_fetch(this.sasUrl, { agent: this.agent }); await drainStream(response.body); } diff --git a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts index 6ee36a2bdb21..3ba80f18c718 100644 --- a/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/upload.spec.ts @@ -28,7 +28,7 @@ export class StorageBlobUploadTest extends StorageBlobTest { + async run(): Promise { await this.containerClient.uploadBlockBlob( this.blobName, this.buffer, diff --git a/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts index 1daeed221255..6f4d37b2b9e5 100644 --- a/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-blob/test/uploadFromFile.spec.ts @@ -31,7 +31,7 @@ export class StorageBlobUploadFileTest extends StorageBlobUploadTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.blockBlobClient.uploadFile(fileName); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts index afe05cc6d9d5..548623505cb6 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/append.spec.ts @@ -32,7 +32,7 @@ export class StorageDFSAppendTest extends StorageDFSTest { + async run(): Promise { await this.fileClient.append(this.buffer, 0, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts index 57e11be25924..b80e82b3516a 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/read.spec.ts @@ -32,7 +32,7 @@ export class StorageDFSReadTest extends StorageDFSTest { + async run(): Promise { const ReadResponse = await this.fileClient.read(); await drainStream(ReadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts index 6b386dd5b02a..be3dbb999ede 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/upload.spec.ts @@ -30,7 +30,7 @@ export class StorageDFSUploadTest extends StorageDFSTest { + async run(): Promise { await this.fileClient.upload(this.buffer); } } diff --git a/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts index 8a4ad73266d7..9fd7c15b80ff 100644 --- a/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-datalake/test/uploadFromFile.spec.ts @@ -24,7 +24,7 @@ export class StorageDFSUploadFromFileTest extends StorageDFSUploadTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadFile(localFileName); } } diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts index 1fd3c5ddf3d8..01e09bb07369 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/download.spec.ts @@ -42,7 +42,7 @@ export class StorageFileShareDownloadTest extends StorageFileShareTest< await this.fileClient.uploadRange(Aborter.none, this.buffer, 0, this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.fileClient.download(Aborter.none, 0); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts index b0af193cabcb..7d35c1ca0b4b 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share-track-1/test/upload.spec.ts @@ -35,7 +35,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< await this.fileClient.create(Aborter.none, this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadRange(Aborter.none, this.buffer, 0, this.parsedOptions.size.value!); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts index 8d6f827a9398..d19511f513f5 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/download.spec.ts @@ -35,7 +35,7 @@ export class StorageFileShareDownloadTest extends StorageFileShareTest< await this.fileClient.uploadData(Buffer.alloc(this.parsedOptions.size.value!)); } - async runAsync(): Promise { + async run(): Promise { const downloadResponse = await this.fileClient.download(); await drainStream(downloadResponse.readableStreamBody!); } diff --git a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts index 53b327426dc2..73285dacf37d 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/downloadToFile.spec.ts @@ -51,7 +51,7 @@ export class StorageFileShareDownloadToFileTest extends StorageFileShareTest< await deleteFile(`${localDirName}/${this.localFileName}`); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.downloadToFile(`${localDirName}/${this.localFileName}`, 0); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts index 41b3b0410c67..076e9c441762 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/upload.spec.ts @@ -32,7 +32,7 @@ export class StorageFileShareUploadTest extends StorageFileShareTest< this.buffer = Buffer.alloc(this.parsedOptions.size.value!); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadData(this.buffer); } } diff --git a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts index 9c298973fa9d..6261be9aacc4 100644 --- a/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts +++ b/sdk/storage/perf-tests/storage-file-share/test/uploadFromFile.spec.ts @@ -50,7 +50,7 @@ export class StorageFileShareUploadFromFileTest extends StorageFileShareTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { await this.fileClient.uploadFile(localFileName); } } diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts index b108590b4957..be8cfe7e470e 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntity.spec.ts @@ -18,7 +18,7 @@ export class CreateComplexEntityTest extends TablesTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const complexEntity: TableEntity = createComplexEntity(); await this.client.createEntity(complexEntity); } diff --git a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts index 3894e30ce820..48b9bcb516f0 100644 --- a/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createComplexEntityBatchTest.spec.ts @@ -31,7 +31,7 @@ export class CreateComplexEntityBatchTest extends TablesTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const batches: TransactionAction[][] = createBatch( "complex", this.parsedOptions.batchSize.value! diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts index 2ae5b43c853a..b02629abcf3e 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntity.spec.ts @@ -18,7 +18,7 @@ export class CreateSimpleEntityTest extends TablesTest { await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const simpleEntity: TableEntity = createSimpleEntity(); await this.client.createEntity(simpleEntity); } diff --git a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts index d5d25f142d63..5b35bd79d6a2 100644 --- a/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/createSimpleEntityBatchTest.spec.ts @@ -31,7 +31,7 @@ export class CreateSimpleEntityBatchTest extends TablesTest< await super.globalCleanup(); } - async runAsync(): Promise { + async run(): Promise { const batches: TransactionAction[][] = createBatch( "simple", this.parsedOptions.batchSize.value! diff --git a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts index 80f626f5a783..1da0068a5153 100644 --- a/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listComplexEntities.spec.ts @@ -37,7 +37,7 @@ export class ListComplexEntitiesTest extends TablesTest { + async run(): Promise { const iter = this.client.listEntities(); const entities: TableEntityResult>[] = []; diff --git a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts index cf90116d81af..c6b7a894a228 100644 --- a/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/listSimpleEntities.spec.ts @@ -37,7 +37,7 @@ export class ListSimpleEntitiesTest extends TablesTest { + async run(): Promise { const iter = this.client.listEntities(); const entities: TableEntityResult>[] = []; diff --git a/sdk/test-utils/perf/GettingStarted.md b/sdk/test-utils/perf/GettingStarted.md index 64dc53d23ff0..d2184885314d 100644 --- a/sdk/test-utils/perf/GettingStarted.md +++ b/sdk/test-utils/perf/GettingStarted.md @@ -201,7 +201,7 @@ export class `ServiceNameAPIName`Test extends ServiceNameTest { // Add any additional setup } - async runAsync(): Promise { + async run(): Promise { // call the method on `serviceNameClient` that you're interested in testing } } @@ -231,8 +231,8 @@ export class `ServiceNameAPIName`Test extends ServiceNameTest<`ServiceNameAPINam } }; - async runAsync(): Promise { - // You can leverage the parsedOptions in the setup or globalSetup or runAsync methods as shown below. + async run(): Promise { + // You can leverage the parsedOptions in the setup or globalSetup or run methods as shown below. // this.parsedOptions.duration.value! // this.parsedOptions.newOption.value! } diff --git a/sdk/test-utils/perf/README.md b/sdk/test-utils/perf/README.md index 2a6b26e6408d..3627b3971a0c 100644 --- a/sdk/test-utils/perf/README.md +++ b/sdk/test-utils/perf/README.md @@ -9,13 +9,13 @@ Link to the wiki - [Writing-Performance-Tests](https://github.com/Azure/azure-sd ## KeyConcepts - A **PerfTest** test is a test that will be executed repeatedly to show both the performance of the program, and how it behaves under stress. -- Tests have an asynchronous method called `runAsync` which is executed based on the duration, iterations, and parallel options provided for the perf test. More about options below. +- Tests have an asynchronous method called `run` which is executed based on the duration, iterations, and parallel options provided for the perf test. More about options below. - A **PerfOption** is a command line parameter. We use `minimist` to parse them appropriately, and then to consolidate them in a dictionary of options that is called `PerfOptionDictionary`. The dictionary class accepts a union type of strings that defines the options that are allowed by each test. - Some default options are parsed by the Perf program. Their longer names are: `help`, `no-cleanups`, `parallel`, `duration`, `warmup`, `iterations`, `no-cleanup` and `milliseconds-to-log`. - Perf tests are executed as many times as possible until the `duration` parameter is specified. This process may repeat as many `iterations` are given. Before each iteration, tests might be called for a period of time up to `warmup`, to adjust to possible runtime optimizations. In each iteration, as many as `parallel` instances of the same test are called without waiting for each other, letting the event loop decide which one is prioritized (it's not true parallelism, but it's an approximation that aligns with the design in other languages, we might improve it over time). - Each test can have a `globalSetup` method, which is called once before the process begins, a `globalCleanup` method, which is called once after the process finishes. - Each test can have a `setup` method, which is called as many times as test instances are created (up to `parallel`), and help specify local state for each test instance. A `cleanup` method is also optional, called the same amount of times, but after finishing running the tests. -- `test-proxies` url option - this option can be leveraged to avoid hitting throttling scenarios while testing the services. This option lets the requests go through proxy server(s) based on the url(s) provided, we run runAsync method once in record mode to save the requests and responses in memory and then a ton of times in playback. Workflow with the test-proxies below. +- `test-proxies` url option - this option can be leveraged to avoid hitting throttling scenarios while testing the services. This option lets the requests go through proxy server(s) based on the url(s) provided, we run the `run` method once in record mode to save the requests and responses in memory and then a ton of times in playback. Workflow with the test-proxies below. ## Workflow with test proxy @@ -26,7 +26,7 @@ Steps below constitute the workflow of a typical perf test. - then start record - making a request to the proxy server to start recording - proxy server gives a recording id, we'll use this id to save the actual requests and responses -- run the runAsync once +- run the `run` method once - proxy-server saves all the requests and responses in memory - stop record - making a request to the proxy server to stop recording @@ -34,10 +34,10 @@ Steps below constitute the workflow of a typical perf test. - making a request to the proxy server to start playback - we use the same recording-id that we used in the record mode since that's the only way proxy-server knows what requests are supposed to be played back - As a response, we get a new recording-id, which will be used for future playback requests -- run runAsync again +- run the `run` method again - based on the duration, iterations, and parallel options provided for the perf test - - all the requests in the runAsync method are played back since we have already recorded them before -- when the runAsync loops end, stop playback + - all the requests in the `run` method are played back since we have already recorded them before +- when the `run` loops end, stop playback - making a request to the proxy server to stop playing back - delete the live resources that we have created before diff --git a/sdk/test-utils/perf/src/program.ts b/sdk/test-utils/perf/src/program.ts index c0f29bb9b032..0cda0f9b37f5 100644 --- a/sdk/test-utils/perf/src/program.ts +++ b/sdk/test-utils/perf/src/program.ts @@ -137,12 +137,12 @@ export class PerfProgram { durationMilliseconds: number, abortController: AbortController ): Promise { - if (!test.runAsync) { - throw new Error(`The "runAsync" method is missing in the test ${this.testName}`); + if (!test.run) { + throw new Error(`The "run" method is missing in the test ${this.testName}`); } const start = process.hrtime(); while (!abortController.signal.aborted) { - await test.runAsync(abortController.signal); + await test.run(abortController.signal); const elapsed = process.hrtime(start); const elapsedMilliseconds = elapsed[0] * 1000 + elapsed[1] / 1000000; @@ -287,7 +287,7 @@ export class PerfProgram { } if (this.tests[0].parsedOptions["test-proxies"].value) { - // Records requests(in runAsync method) for all the instantiated PerfTest classes, + // Records requests(in the run method) for all the instantiated PerfTest classes, // and asks the proxy-tool to start playing back for future requests. await Promise.all(this.tests.map((test) => this.recordAndStartPlayback(test))); } @@ -326,7 +326,7 @@ export class PerfProgram { /** * This method records the requests-responses and lets the proxy-server know when to playback. - * We run runAsync once in record mode to save the requests and responses in memory and then a ton of times in playback. + * We run run() once in record mode to save the requests and responses in memory and then a ton of times in playback. * * ## Workflow of the perf test * - test resources are setup @@ -334,7 +334,7 @@ export class PerfProgram { * - then start record * - making a request to the proxy server to start recording * - proxy server gives a recording id, we'll use this id to save the actual requests and responses - * - run the runAsync once + * - run the run method once * - proxy-server saves all the requests and responses in memory * - stop record * - making a request to the proxy server to stop recording @@ -342,17 +342,17 @@ export class PerfProgram { * - making a request to the proxy server to start playback * - we use the same recording-id that we used in the record mode since that's the only way proxy-server knows what requests are supposed to be played back * - as a response, we get a new recording-id, which will be used for future playback requests - * - run runAsync again + * - run the run method again * - based on the duration, iterations, and parallel options provided for the perf test - * - all the requests in the runAsync method are played back since we have already recorded them before - * - when the runAsync loops end, stop playback + * - all the requests in the run method are played back since we have already recorded them before + * - when the run loops end, stop playback * - making a request to the proxy server to stop playing back * - delete the live resources that we have created before */ private async recordAndStartPlayback(test: PerfTest) { // If test-proxy, // => then start record - // => run the runAsync + // => call the run method // => stop record // => start playback let recorder: TestProxyHttpClientV1 | TestProxyHttpClient; @@ -367,11 +367,11 @@ export class PerfProgram { } // Call Run() once before starting recording, to avoid capturing one-time setup like authorization requests. - await test.runAsync!(); + await test.run!(); await recorder.startRecording(); recorder._mode = "record"; - await test.runAsync!(); + await test.run!(); await recorder.stopRecording(); await recorder.startPlayback(); diff --git a/sdk/test-utils/perf/src/testProxyHttpClient.ts b/sdk/test-utils/perf/src/testProxyHttpClient.ts index 21ca5b65ef7d..e37a4fcc9062 100644 --- a/sdk/test-utils/perf/src/testProxyHttpClient.ts +++ b/sdk/test-utils/perf/src/testProxyHttpClient.ts @@ -23,7 +23,7 @@ const paths = { * Helper class to manage the recording state to make sure the proxy-tool is not flooded with unintended requests. * * => then start record - * => run the runAsync + * => run the run method * => stop record * => start playback * => stop playback diff --git a/sdk/test-utils/perf/src/tests.ts b/sdk/test-utils/perf/src/tests.ts index 5c60f4f254bb..78e9b1155df8 100644 --- a/sdk/test-utils/perf/src/tests.ts +++ b/sdk/test-utils/perf/src/tests.ts @@ -71,7 +71,7 @@ export abstract class PerfTest { public setup?(): void | Promise; public cleanup?(): void | Promise; - public async runAsync?(abortSignal?: AbortSignalLike): Promise; + public async run?(abortSignal?: AbortSignalLike): Promise; /** * configureClientOptionsCoreV1 diff --git a/sdk/test-utils/perf/test/delay.spec.ts b/sdk/test-utils/perf/test/delay.spec.ts index a7d1769baec1..1fc3918ce29f 100644 --- a/sdk/test-utils/perf/test/delay.spec.ts +++ b/sdk/test-utils/perf/test/delay.spec.ts @@ -41,7 +41,7 @@ export class Delay500ms extends PerfTest { /** * Waits 500 milliseconds. */ - async runAsync(): Promise { + async run(): Promise { await delay(500); } } diff --git a/sdk/test-utils/perf/test/exception.spec.ts b/sdk/test-utils/perf/test/exception.spec.ts index dccf37cd1566..c7ac565ba8a9 100644 --- a/sdk/test-utils/perf/test/exception.spec.ts +++ b/sdk/test-utils/perf/test/exception.spec.ts @@ -11,7 +11,7 @@ import { PerfTest } from "../src"; export class Exception extends PerfTest { public options = {}; - async runAsync(): Promise { + async run(): Promise { try { throw new Error(); } catch (e) { diff --git a/sdk/test-utils/perf/test/nodeFetch.spec.ts b/sdk/test-utils/perf/test/nodeFetch.spec.ts index 26d62cf48017..24f462066210 100644 --- a/sdk/test-utils/perf/test/nodeFetch.spec.ts +++ b/sdk/test-utils/perf/test/nodeFetch.spec.ts @@ -32,7 +32,7 @@ export class NodeFetchTest extends PerfTest { this.url = this.options.url.value as string; } - async runAsync(): Promise { + async run(): Promise { const response = await fetch(this.url, NodeFetchTest.fetchOptions); await response.text(); } diff --git a/sdk/test-utils/perf/test/noop.spec.ts b/sdk/test-utils/perf/test/noop.spec.ts index 0fb963ccdb22..bab32d4aad9d 100644 --- a/sdk/test-utils/perf/test/noop.spec.ts +++ b/sdk/test-utils/perf/test/noop.spec.ts @@ -9,5 +9,5 @@ import { PerfTest } from "../src"; export class NoOp extends PerfTest { public options = {}; - async runAsync(): Promise {} + async run(): Promise {} } diff --git a/sdk/test-utils/perf/test/options.spec.ts b/sdk/test-utils/perf/test/options.spec.ts index 8729283dcb5d..7a1c7bf65847 100644 --- a/sdk/test-utils/perf/test/options.spec.ts +++ b/sdk/test-utils/perf/test/options.spec.ts @@ -71,7 +71,7 @@ export class OptionsTest extends PerfTest { } } - async runAsync() { + async run() { for (const key in this.options) { this.compare(key as keyof OptionsTestOptions); } diff --git a/sdk/test-utils/perf/test/perfPolicy.spec.ts b/sdk/test-utils/perf/test/perfPolicy.spec.ts index f023f988f092..fda670ce5d04 100644 --- a/sdk/test-utils/perf/test/perfPolicy.spec.ts +++ b/sdk/test-utils/perf/test/perfPolicy.spec.ts @@ -32,7 +32,7 @@ export class PerfPolicyTest extends PerfTest { shortName: "u" } }; - async runAsync(): Promise { + async run(): Promise { const targetUrl = url.parse(this.parsedOptions.url.value!); const differentUrl = url.parse(this.parsedOptions.url.value!); differentUrl.host = `not-${differentUrl.host}`; diff --git a/sdk/test-utils/perf/test/serviceClientGet.spec.ts b/sdk/test-utils/perf/test/serviceClientGet.spec.ts index c37f64dad32e..9ed6442cb109 100644 --- a/sdk/test-utils/perf/test/serviceClientGet.spec.ts +++ b/sdk/test-utils/perf/test/serviceClientGet.spec.ts @@ -49,7 +49,7 @@ export class ServiceClientGetTest extends PerfTest { } } - async runAsync(): Promise { + async run(): Promise { var response; if (this.firstRun) { diff --git a/sdk/test-utils/perf/test/setupCleanup.spec.ts b/sdk/test-utils/perf/test/setupCleanup.spec.ts index 1c5949cbba01..6c3c0940eb1d 100644 --- a/sdk/test-utils/perf/test/setupCleanup.spec.ts +++ b/sdk/test-utils/perf/test/setupCleanup.spec.ts @@ -47,5 +47,5 @@ export class SetupCleanupTest extends PerfTest { } } - async runAsync() {} + async run() {} } diff --git a/sdk/test-utils/perf/test/sleep.spec.ts b/sdk/test-utils/perf/test/sleep.spec.ts index b9cf02cadb94..5cebcff5b863 100644 --- a/sdk/test-utils/perf/test/sleep.spec.ts +++ b/sdk/test-utils/perf/test/sleep.spec.ts @@ -21,7 +21,7 @@ export class SleepTest extends PerfTest { this.secondsPerOperation = Math.pow(2, SleepTest.instanceCount); } - async runAsync(): Promise { + async run(): Promise { await delay(this.secondsPerOperation * 1000); } } diff --git a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts index e8cd7f484481..d7dfde24cf83 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts +++ b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts @@ -49,7 +49,7 @@ export class DetectLanguageTest extends PerfTest this.client = new TextAnalyticsClient(endpoint, credential); } - async runAsync(): Promise { + async run(): Promise { await this.client.detectLanguage(this.docs, "en"); } } From f9f75e6171332d41127ea82f49c8fb2b63491c14 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 20 Oct 2021 15:05:43 -0700 Subject: [PATCH 3/8] Remove accidental changes to the changelog --- sdk/test-utils/perf/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/test-utils/perf/CHANGELOG.md b/sdk/test-utils/perf/CHANGELOG.md index 1a2128fc8b36..06b7266c85e9 100644 --- a/sdk/test-utils/perf/CHANGELOG.md +++ b/sdk/test-utils/perf/CHANGELOG.md @@ -21,7 +21,7 @@ ### 2021-09-24 -- Instead of using the cached proxy-clients(to leverage the proxy-tool), we now get a new client for each of the instantiated PerfTest classes. [#17832](https://github.com/Azure/azure-sdk-for-js/pull/17832) +- Instead of using the cached proxy-clients(to leverage the proxy-tool), we now get a new client for each of the instantiated PerfStressTest classes. [#17832](https://github.com/Azure/azure-sdk-for-js/pull/17832) ### 2021-09-23 @@ -39,8 +39,8 @@ ### 2021-07-14 -- Removed the run method in the `PerfTest` class as we only deal with the async methods when it comes to performance. +- Removed the run method in the `PerfStressTest` class as we only deal with the async methods when it comes to performance. ### 2020-04-22 -- Merged the first working implementation of perf. +- Merged the first working implementation of perfstress. From 83e1d0f54c9b9176a6515b6c749ab3588573a107 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 20 Oct 2021 15:10:45 -0700 Subject: [PATCH 4/8] Add CHANGELOG entry --- sdk/test-utils/perf/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/test-utils/perf/CHANGELOG.md b/sdk/test-utils/perf/CHANGELOG.md index 06b7266c85e9..2a1ba083cdab 100644 --- a/sdk/test-utils/perf/CHANGELOG.md +++ b/sdk/test-utils/perf/CHANGELOG.md @@ -2,6 +2,11 @@ ## 1.0.0 (Unreleased) +### 2021-10-20 + +- Clean up some naming: `PerfStress` to `Perf` everywhere; also rename the `runAsync` method to `run`. + [#18290](https://github.com/Azure/azure-sdk-for-js/pull/18290) + ### 2021-10-05 - Support multiple test proxies From 790c64a6e7307a32a5835aac40decfee4fd33d43 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Wed, 20 Oct 2021 15:19:35 -0700 Subject: [PATCH 5/8] Update README GettingStarted.md link to point to main branch --- sdk/test-utils/perf/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/test-utils/perf/README.md b/sdk/test-utils/perf/README.md index 3627b3971a0c..cd8cca1fce9b 100644 --- a/sdk/test-utils/perf/README.md +++ b/sdk/test-utils/perf/README.md @@ -2,7 +2,7 @@ ## Getting started -To start a new perf test project for the your SDK in the js repository, follow the steps in the [GettingStarted.md](https://github.com/Azure/azure-sdk-for-js/blob/c1c5f556a1a29d4a38019f1cc97fadb99375d6d5/sdk/test-utils/perf/GettingStarted.md). +To start a new perf test project for the your SDK in the js repository, follow the steps in the [GettingStarted.md](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/test-utils/perf/GettingStarted.md). Link to the wiki - [Writing-Performance-Tests](https://github.com/Azure/azure-sdk-for-js/wiki/Writing-Performance-Tests) (has the same contents as the GettingStarted docs) From 88e416f748ba5ec80867d2d46b5c0d80a1242504 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Thu, 21 Oct 2021 12:57:14 -0700 Subject: [PATCH 6/8] Don't target es5 in storage-blob-track-1 perf tests to fix error --- sdk/storage/perf-tests/storage-blob-track-1/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/storage/perf-tests/storage-blob-track-1/tsconfig.json b/sdk/storage/perf-tests/storage-blob-track-1/tsconfig.json index d9fca9ba85b4..7ec349900a57 100644 --- a/sdk/storage/perf-tests/storage-blob-track-1/tsconfig.json +++ b/sdk/storage/perf-tests/storage-blob-track-1/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../../tsconfig.package", "compilerOptions": { - "target": "es5", "module": "commonjs", "declarationDir": "./typings/latest", "outDir": "./dist-esm", From 3314fc97ac9f95614718f5a118734cfe8dad3c81 Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Thu, 21 Oct 2021 13:13:45 -0700 Subject: [PATCH 7/8] Formatting fixes --- .../perf-tests/container-registry/test/index.spec.ts | 4 +--- sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts | 4 +--- .../perf-tests/eventgrid/test/sendCloudEvents.spec.ts | 6 +----- sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts | 6 +----- .../perf-tests/ai-form-recognizer/test/custom.spec.ts | 6 +----- sdk/identity/perf-tests/identity/test/index.spec.ts | 4 +--- sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts | 4 +--- sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts | 4 +--- .../search-documents/test/core/searchDocumentsBase.spec.ts | 6 +++--- sdk/tables/perf-tests/data-tables/test/tables.spec.ts | 4 +--- sdk/test-utils/perf/src/tests.ts | 4 +--- .../perf-tests/text-analytics/test/detectLanguage.spec.ts | 6 +----- 12 files changed, 14 insertions(+), 44 deletions(-) diff --git a/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts b/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts index 1fdd8d5777f2..e73db29a41bb 100644 --- a/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts +++ b/sdk/containerregistry/perf-tests/container-registry/test/index.spec.ts @@ -6,7 +6,5 @@ import { ArtifactListTest } from "./listArtifacts.spec"; import { RepositoryListTest } from "./listRepositories.spec"; console.log("=== Starting the perf test ==="); -const perfProgram = new PerfProgram( - selectPerfTest([RepositoryListTest, ArtifactListTest]) -); +const perfProgram = new PerfProgram(selectPerfTest([RepositoryListTest, ArtifactListTest])); perfProgram.run(); diff --git a/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts b/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts index 83a586fd3415..b1d4da00252d 100644 --- a/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts +++ b/sdk/core/perf-tests/core-rest-pipeline/test/index.spec.ts @@ -3,8 +3,6 @@ import { BearerTokenAuthenticationPolicyChallengeTest } from "./bearerTokenChall console.log("=== Starting the perf test ==="); -const perfProgram = new PerfProgram( - selectPerfTest([BearerTokenAuthenticationPolicyChallengeTest]) -); +const perfProgram = new PerfProgram(selectPerfTest([BearerTokenAuthenticationPolicyChallengeTest])); perfProgram.run(); diff --git a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts index 707fb06c1c5c..601d4cb24227 100644 --- a/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts +++ b/sdk/eventgrid/perf-tests/eventgrid/test/sendCloudEvents.spec.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - PerfTest, - PerfOptionDictionary, - getEnvVar -} from "@azure/test-utils-perf"; +import { PerfTest, PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { EventGridPublisherClient, AzureKeyCredential, diff --git a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts index e9147d1d8bfa..41009a6d7b4c 100644 --- a/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts +++ b/sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - getEnvVar, - PerfOptionDictionary, - PerfTest -} from "@azure/test-utils-perf"; +import { getEnvVar, PerfOptionDictionary, PerfTest } from "@azure/test-utils-perf"; import { EventHubProducerClient, EventData } from "@azure/event-hubs"; // Expects the .env file at the same level as the "test" folder diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts index b0e50ba72e44..6945d4cd92a1 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/test/custom.spec.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - PerfOptionDictionary, - PerfTest, - getEnvVar -} from "@azure/test-utils-perf"; +import { PerfOptionDictionary, PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { AzureKeyCredential, BeginRecognizeCustomFormsOptions, diff --git a/sdk/identity/perf-tests/identity/test/index.spec.ts b/sdk/identity/perf-tests/identity/test/index.spec.ts index af05fbe657b6..29b1c7f5ab37 100644 --- a/sdk/identity/perf-tests/identity/test/index.spec.ts +++ b/sdk/identity/perf-tests/identity/test/index.spec.ts @@ -5,8 +5,6 @@ dotenv.config(); console.log("=== Starting the perf test ==="); -const perfProgram = new PerfProgram( - selectPerfTest([ClientSecretCredentialPersistenceTest]) -); +const perfProgram = new PerfProgram(selectPerfTest([ClientSecretCredentialPersistenceTest])); perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts index 978ce0a13820..88a9e4ab9fb9 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/index.spec.ts @@ -4,8 +4,6 @@ import { ListSecretsTest } from "./listSecrets.spec"; console.log("=== Starting the perf test ==="); -const perfProgram = new PerfProgram( - selectPerfTest([GetSecretTest, ListSecretsTest]) -); +const perfProgram = new PerfProgram(selectPerfTest([GetSecretTest, ListSecretsTest])); perfProgram.run(); diff --git a/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts b/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts index 7444230dcd72..23c622037a9a 100644 --- a/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts +++ b/sdk/keyvault/perf-tests/keyvault-secrets/test/secretTest.ts @@ -2,9 +2,7 @@ import { SecretClient } from "@azure/keyvault-secrets"; import { PerfTest } from "@azure/test-utils-perf"; import { keyVaultUri, credential } from "./utils"; -export abstract class SecretTest> extends PerfTest< - TOptions -> { +export abstract class SecretTest> extends PerfTest { secretClient: SecretClient; constructor() { diff --git a/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts b/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts index cbfccdcdeb2f..f1f72b84e72a 100644 --- a/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts +++ b/sdk/search/perf-tests/search-documents/test/core/searchDocumentsBase.spec.ts @@ -13,9 +13,9 @@ export interface SearchDocumentsTestOptions { documentsCount: number; } -export abstract class SearchDocumentsBase< - TOptions = Record -> extends PerfTest { +export abstract class SearchDocumentsBase> extends PerfTest< + TOptions +> { searchIndexClient: SearchIndexClient; searchClient: SearchClient; indexName: string; diff --git a/sdk/tables/perf-tests/data-tables/test/tables.spec.ts b/sdk/tables/perf-tests/data-tables/test/tables.spec.ts index c78012d78425..717a1495c475 100644 --- a/sdk/tables/perf-tests/data-tables/test/tables.spec.ts +++ b/sdk/tables/perf-tests/data-tables/test/tables.spec.ts @@ -2,9 +2,7 @@ import { PerfTest, getEnvVar } from "@azure/test-utils-perf"; import { TableClient } from "@azure/data-tables"; -export abstract class TablesTest> extends PerfTest< - TOptions -> { +export abstract class TablesTest> extends PerfTest { client: TableClient; constructor(tableName: string) { super(); diff --git a/sdk/test-utils/perf/src/tests.ts b/sdk/test-utils/perf/src/tests.ts index 78e9b1155df8..eb2d12c57461 100644 --- a/sdk/test-utils/perf/src/tests.ts +++ b/sdk/test-utils/perf/src/tests.ts @@ -123,9 +123,7 @@ export abstract class PerfTest { * given classes, all of which must extend PerfTest. * @param tests An array of classes that extend PerfTest */ -export function selectPerfTest( - tests: PerfTestConstructor[] -): PerfTestConstructor { +export function selectPerfTest(tests: PerfTestConstructor[]): PerfTestConstructor { const testsNames: string[] = tests.map((test) => test.name); const minimistResult: MinimistParsedArgs = minimist(process.argv); const testName = minimistResult._[minimistResult._.length - 1]; diff --git a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts index d7dfde24cf83..579ae2e0bea2 100644 --- a/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts +++ b/sdk/textanalytics/perf-tests/text-analytics/test/detectLanguage.spec.ts @@ -1,11 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { - PerfTest, - PerfOptionDictionary, - getEnvVar -} from "@azure/test-utils-perf"; +import { PerfTest, PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf"; import { AzureKeyCredential, TextAnalyticsClient, From ae44c66467b758aee126bba12212b7396fc1811a Mon Sep 17 00:00:00 2001 From: Timo van Veenendaal Date: Thu, 21 Oct 2021 13:28:54 -0700 Subject: [PATCH 8/8] Remove es5 target from storage-file-share-track-1 perf tests --- sdk/storage/perf-tests/storage-file-share-track-1/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/storage/perf-tests/storage-file-share-track-1/tsconfig.json b/sdk/storage/perf-tests/storage-file-share-track-1/tsconfig.json index d9fca9ba85b4..7ec349900a57 100644 --- a/sdk/storage/perf-tests/storage-file-share-track-1/tsconfig.json +++ b/sdk/storage/perf-tests/storage-file-share-track-1/tsconfig.json @@ -1,7 +1,6 @@ { "extends": "../../../../tsconfig.package", "compilerOptions": { - "target": "es5", "module": "commonjs", "declarationDir": "./typings/latest", "outDir": "./dist-esm",