Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Perf] Make perf package public for consumption outside this repo #28916

Merged
merged 8 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 84 additions & 84 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const examplePackageGood = `{
"@azure/identity": "^2.0.1",
"@azure/mock-hub": "^1.0.0",
"@azure/test-utils": "^1.0.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-inject": "^4.0.0",
Expand Down Expand Up @@ -264,7 +264,7 @@ const examplePackageBad = `{
"@azure/identity": "^2.0.1",
"@azure/mock-hub": "^1.0.0",
"@azure/test-utils": "^1.0.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"@microsoft/api-extractor": "^7.31.1",
"@rollup/plugin-commonjs": "11.0.2",
"@rollup/plugin-inject": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion rush.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@
"versionPolicyName": "utility"
},
{
"packageName": "@azure/test-utils-perf",
"packageName": "@azure-tools/test-perf",
"projectFolder": "sdk/test-utils/perf",
"versionPolicyName": "utility"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@azure/app-configuration": "1.5.0-beta.2",
"@azure/core-util": "^1.6.1",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PerfTest, getEnvVar } from "@azure/test-utils-perf";
import { PerfTest, getEnvVar } from "@azure-tools/test-perf";
import { AppConfigurationClient } from "@azure/app-configuration";
// Expects the .env file at the same level
import * as dotenv from "dotenv";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { ListSettingsTest } from "./listSettings.spec";

const perfProgram = createPerfProgram(ListSettingsTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import { randomUUID } from "@azure/core-util";
import { PerfOptionDictionary, executeParallel } from "@azure/test-utils-perf";
import { PerfOptionDictionary, executeParallel } from "@azure-tools/test-perf";
import { AppConfigTest } from "./appConfigBase.spec";

interface ListTestOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@azure/ai-language-text": "^1.1.0",
"@azure/identity": "^4.0.1",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { LanguageDetectionTest } from "./languageDetection.spec";

import dotenv from "dotenv";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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-tools/test-perf";
import {
AzureKeyCredential,
TextAnalysisClient,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "ISC",
"dependencies": {
"@azure/container-registry": "^1.1.0-beta.1",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { PerfTest, getEnvVar } from "@azure/test-utils-perf";
import { PerfTest, getEnvVar } from "@azure-tools/test-perf";
import { ContainerRegistryClient } from "@azure/container-registry";

// Expects the .env file at the same level
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { ArtifactListTest } from "./listArtifacts.spec";
import { RepositoryListTest } from "./listRepositories.spec";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { PerfOptionDictionary, getEnvVar } from "@azure/test-utils-perf";
import { PerfOptionDictionary, getEnvVar } from "@azure-tools/test-perf";
import { ContainerRepository } from "@azure/container-registry";
import { ContainerRegistryTest, ContainerRegistryTestOptions } from "./client.spec";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { PerfOptionDictionary } from "@azure/test-utils-perf";
import { PerfOptionDictionary } from "@azure-tools/test-perf";
import { ContainerRegistryTest, ContainerRegistryTestOptions } from "./client.spec";

export class RepositoryListTest extends ContainerRegistryTest<ContainerRegistryTestOptions> {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/perf-tests/core-rest-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@azure/core-rest-pipeline": "^1.1.0",
"@azure/core-auth": "^1.3.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0",
"undici": "^6.0.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.

import express from "express";
import { PerfOptionDictionary, PerfTest } from "@azure/test-utils-perf";
import { PerfOptionDictionary, PerfTest } from "@azure-tools/test-perf";
import { Server } from "node:http";
import { AddressInfo } from "node:net";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { PerfTest } from "@azure/test-utils-perf";
import { PerfTest } from "@azure-tools/test-perf";
import type { AccessToken, GetTokenOptions, TokenCredential } from "@azure/core-auth";
import {
AuthorizeRequestOnChallengeOptions,
Expand Down Expand Up @@ -104,7 +104,7 @@ class MockRefreshAzureCredential implements TokenCredential {
public authCount = 0;
public scopesAndClaims: { scope: string | string[]; challengeClaims: string | undefined }[] = [];

constructor(public getTokenResponse: AccessToken) {}
constructor(public getTokenResponse: AccessToken) { }

public getToken(
scope: string | string[],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { BearerTokenAuthenticationPolicyChallengeTest } from "./bearerTokenChallengeAuthenticationPolicy/wwwChallenge.spec.js";
import { CoreRestPipelineTest } from "./core-rest-pipeline.spec.js";
import { FetchTest } from "./fetch.spec.js";
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/perf-tests/eventgrid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"license": "ISC",
"dependencies": {
"@azure/eventgrid": "^5.0.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventgrid/perf-tests/eventgrid/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { SendCloudEventsTest } from "./sendCloudEvents.spec";

import dotenv from "dotenv";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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-tools/test-perf";
import {
EventGridPublisherClient,
AzureKeyCredential,
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/perf-tests/event-hubs-track-1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@azure/core-amqp": "^3.0.0",
"@azure/event-hubs": "^2.1.4",
"uuid": "^8.3.0",
"@azure/test-utils-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz",
"@azure-tools/test-perf": "file:../../../test-utils/perf/azure-test-utils-perf-1.0.0.tgz",
"dotenv": "^16.0.0",
"moment": "^2.24.0"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { SendTest } from "./send.spec";

const perfProgram = createPerfProgram(SendTest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-perf";
import { getEnvVar } from "@azure-tools/test-perf";
import moment from "moment";
import { delay } from "@azure/core-amqp";

Expand Down Expand Up @@ -130,11 +130,11 @@ function WriteResult(
const memoryUsage = process.memoryUsage();
log(
`\tTot Msg\t${totalMessages}` +
`\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` +
`\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` +
`\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` +
`\tRSS\t${memoryUsage.rss}` +
`\tHeapUsed\t${memoryUsage.heapUsed}`
`\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` +
`\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` +
`\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` +
`\tRSS\t${memoryUsage.rss}` +
`\tHeapUsed\t${memoryUsage.heapUsed}`
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getEnvVar,
PerfOptionDictionary,
PerfTest
} from "@azure/test-utils-perf";
} from "@azure-tools/test-perf";
import { EventHubClient, EventData } from "@azure/event-hubs";

import { config } from "dotenv";
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/perf-tests/event-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@azure/event-hubs": "^5.6.0",
"@azure/core-amqp": "^4.0.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0",
"moment": "^2.24.0",
"uuid": "^8.3.0"
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/perf-tests/event-hubs/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { SendTest } from "./send.spec";
import { SubscribeTest } from "./subscribe.spec";

Expand Down
12 changes: 6 additions & 6 deletions sdk/eventhub/perf-tests/event-hubs/test/receive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
PartitionContext,
EventHubProducerClient,
} from "@azure/event-hubs";
import { getEnvVar } from "@azure/test-utils-perf";
import { getEnvVar } from "@azure-tools/test-perf";
import moment from "moment";
import { delay } from "@azure/core-amqp";

Expand Down Expand Up @@ -148,11 +148,11 @@ function WriteResult(
const memoryUsage = process.memoryUsage();
log(
`\tTot Msg\t${totalMessages}` +
`\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` +
`\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` +
`\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` +
`\tRSS\t${memoryUsage.rss}` +
`\tHeapUsed\t${memoryUsage.heapUsed}`,
`\tCur MPS\t${Math.round((currentMessages * 1000) / currentElapsed)}` +
`\tAvg MPS\t${Math.round((totalMessages * 1000) / totalElapsed)}` +
`\tMax MPS\t${Math.round((maxMessages * 1000) / maxElapsed)}` +
`\tRSS\t${memoryUsage.rss}` +
`\tHeapUsed\t${memoryUsage.heapUsed}`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/perf-tests/event-hubs/test/send.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { getEnvVar, PerfOptionDictionary, BatchPerfTest } from "@azure/test-utils-perf";
import { getEnvVar, PerfOptionDictionary, BatchPerfTest } from "@azure-tools/test-perf";
import { EventHubProducerClient, EventData } from "@azure/event-hubs";

// Expects the .env file at the same level as the "test" folder
Expand Down
8 changes: 3 additions & 5 deletions sdk/eventhub/perf-tests/event-hubs/test/subscribe.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
PartitionContext,
ReceivedEventData,
} from "@azure/event-hubs";
import { PerfOptionDictionary, EventPerfTest, getEnvVar } from "@azure/test-utils-perf";
import { PerfOptionDictionary, EventPerfTest, getEnvVar } from "@azure-tools/test-perf";

interface ReceiverOptions {
"number-of-events": number;
Expand Down Expand Up @@ -123,14 +123,12 @@ export class SubscribeTest extends EventPerfTest<ReceiverOptions> {
// The following might just be noise if we don't think there are related changes to the code
if (this.parsedOptions["log-median-batch-size"].value) {
console.log(
`\tBatch count: ${this.callbackCallsCount}, Batch count per sec: ${
this.callbackCallsCount / this.parsedOptions.duration.value
`\tBatch count: ${this.callbackCallsCount}, Batch count per sec: ${this.callbackCallsCount / this.parsedOptions.duration.value
}`,
);
console.log(`\tmessagesPerBatch: ${this.messagesPerBatch}`);
console.log(
`\tmessagesPerBatch... median: ${median(this.messagesPerBatch)}, avg: ${
this.messagesPerBatch.reduce((a, b) => a + b, 0) / this.messagesPerBatch.length
`\tmessagesPerBatch... median: ${median(this.messagesPerBatch)}, avg: ${this.messagesPerBatch.reduce((a, b) => a + b, 0) / this.messagesPerBatch.length
}, max: ${Math.max(...this.messagesPerBatch)}, min: ${Math.min(...this.messagesPerBatch)}`,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"dependencies": {
"@azure/ai-form-recognizer": "^5.0.0",
"@azure/identity": "^4.0.1",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"@azure/core-util": "^1.3.1",
"dotenv": "^16.0.0",
"tslib": "^2.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +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-tools/test-perf";
import {
AzureKeyCredential,
DocumentModelDetails,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { CustomModelRecognitionTest } from "./custom.spec";

import dotenv from "dotenv";
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/perf-tests/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@azure/identity": "^4.0.1",
"@azure/identity-cache-persistence": "^1.0.0",
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PerfTest, getEnvVar } from "@azure/test-utils-perf";
import { PerfTest, getEnvVar } from "@azure-tools/test-perf";
import { useIdentityPlugin, ClientSecretCredential } from "@azure/identity";

import { cachePersistencePlugin } from "@azure/identity-cache-persistence";
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/perf-tests/identity/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ClientSecretCredentialPersistenceTest } from "./ClientSecretCredential/persistence.spec";
import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import * as dotenv from "dotenv";
dotenv.config();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@azure/test-utils-perf": "^1.0.0",
"@azure-tools/test-perf": "^1.0.0",
"dotenv": "^16.0.0",
"@azure/identity": "^4.0.1",
"uuid": "^8.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PerfTest } from "@azure/test-utils-perf";
import { PerfTest } from "@azure-tools/test-perf";
import { credential, keyVaultUri } from "./utils";
import { CertificateClient, WellKnownIssuer } from "@azure/keyvault-certificates";
import { v4 as uuid } from "uuid";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createPerfProgram } from "@azure/test-utils-perf";
import { createPerfProgram } from "@azure-tools/test-perf";
import { GetCertificateTest } from "./getCertificate.spec";

const perfProgram = createPerfProgram(GetCertificateTest);
Expand Down
Loading
Loading