From 89edee52339ed50818269ef0bec24b3918f35b31 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 02:27:30 -0700 Subject: [PATCH 1/8] add perf tests for monitor-query --- .../perf-tests/monitor-query/README.md | 0 .../perf-tests/monitor-query/package.json | 48 +++++++++++++++++++ .../perf-tests/monitor-query/sample.env | 21 ++++++++ .../monitor-query/test/index.spec.ts | 14 ++++++ .../monitor-query/test/logQuery.spec.ts | 22 +++++++++ .../monitor-query/test/logQueryBatch.spec.ts | 39 +++++++++++++++ .../monitor-query/test/metricQuery.spec.ts | 25 ++++++++++ .../test/monitorQueryLog.spec.ts | 20 ++++++++ .../test/monitorQueryMetrics.spec.ts | 20 ++++++++ .../perf-tests/monitor-query/tsconfig.json | 10 ++++ 10 files changed, 219 insertions(+) create mode 100644 sdk/monitor/perf-tests/monitor-query/README.md create mode 100644 sdk/monitor/perf-tests/monitor-query/package.json create mode 100644 sdk/monitor/perf-tests/monitor-query/sample.env create mode 100644 sdk/monitor/perf-tests/monitor-query/test/index.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts create mode 100644 sdk/monitor/perf-tests/monitor-query/tsconfig.json diff --git a/sdk/monitor/perf-tests/monitor-query/README.md b/sdk/monitor/perf-tests/monitor-query/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sdk/monitor/perf-tests/monitor-query/package.json b/sdk/monitor/perf-tests/monitor-query/package.json new file mode 100644 index 000000000000..404ff6ead743 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/package.json @@ -0,0 +1,48 @@ +{ + "name": "@azure-tests/perf-monitor-query", + "sdk-type": "perf-test", + "version": "1.0.0", + "description": "", + "main": "", + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@azure/monitor-query": "1.0.0-beta.6", + "@azure/test-utils-perfstress": "^1.0.0", + "dotenv": "^8.2.0", + "@azure/identity": "2.0.0-beta.7" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "eslint": "^7.15.0", + "prettier": "^1.16.4", + "rimraf": "^3.0.0", + "tslib": "^2.2.0", + "ts-node": "^10.0.0", + "typescript": "~4.2.0" + }, + "private": true, + "scripts": { + "perf-test:node": "ts-node test/index.spec.ts", + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build": "npm run clean && tsc -p .", + "build:samples": "echo skipped", + "build:test": "echo skipped", + "check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-esm test-dist types *.tgz *.log", + "format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", + "lint:fix": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts", + "pack": "npm pack 2>&1", + "unit-test:browser": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test": "echo skipped", + "test:browser": "echo skipped", + "test:node": "echo skipped", + "test": "echo skipped" + } + } \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/sample.env b/sdk/monitor/perf-tests/monitor-query/sample.env new file mode 100644 index 000000000000..30b090a8026d --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/sample.env @@ -0,0 +1,21 @@ +# Retrieve these values from an instance in the Azure Portal. +MONITOR_WORKSPACE_ID= +METRICS_RESOURCE_ID=> + +# Used by tests and samples to populate data +APPLICATIONINSIGHTS_CONNECTION_STRING= + +# Used to authenticate using Azure AD as a service principal for role-based authentication. +# +# See the documentation for `EnvironmentCredential` at the following link: +# https://docs.microsoft.com/javascript/api/@azure/identity/environmentcredential +AZURE_TENANT_ID= +AZURE_CLIENT_ID= +AZURE_CLIENT_SECRET= + + +# Our tests assume that TEST_MODE is "playback" by default. You can change it +# to "record" to generate new recordings, or "live" to bypass the recorder +# entirely. + +# TEST_MODE="playback" \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts new file mode 100644 index 000000000000..b8e763af1989 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PerfStressProgram, selectPerfStressTest } from "@azure/test-utils-perfstress"; +import { MetricsQueryTest } from "./metricQuery.spec"; +import { LogQueryBatchTest } from "./logQueryBatch.spec"; +import { LogQueryTest } from "./logQuery.spec"; + +console.log("=== Starting the perfStress test ==="); + +const perfStressProgram = new PerfStressProgram( + selectPerfStressTest([MetricsQueryTest, LogQueryBatchTest, LogQueryTest]) +); +perfStressProgram.run(); \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts new file mode 100644 index 000000000000..461c5f327af3 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { MonitorQueryLog } from "./monitorQueryLog.spec"; + +type MonitorQueryTestOptions = Record; + +export class LogQueryTest extends MonitorQueryLog { + workspaceId: string; + query: string; + public options: PerfStressOptionDictionary = {}; + constructor() { + super(); + this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); + this.query = "AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId"; + } + + async runAsync(): Promise { + await this.client.queryWorkspace(this.workspaceId, this.query,{ startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } ); + + } +} \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts new file mode 100644 index 000000000000..d21b4f1c60a9 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import { MonitorQueryLog } from "./monitorQueryLog.spec"; +import {QueryBatch} from "@azure/monitor-query"; + +type MonitorQueryTestOptions = Record; + +export class LogQueryBatchTest extends MonitorQueryLog { + workspaceId: string; + queryBatch: QueryBatch[]; + public options: PerfStressOptionDictionary = {}; + constructor() { + super(); + this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); + this.queryBatch =[ + { + workspaceId: this.workspaceId, + query: "AzureActivity | summarize count()", + timespan: { startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } + }, + { + workspaceId: this.workspaceId, + query: + "AppRequests | take 10 | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId", + timespan: { startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } + }, + { + workspaceId: this.workspaceId, + query: "AppRequests | take 2", + includeQueryStatistics: true + } + ]; + } + + async runAsync(): Promise { + await this.client.queryBatch(this.queryBatch ); + } +} \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts new file mode 100644 index 000000000000..63388c07ad60 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; +import {AggregationType} from "@azure/monitor-query"; +import { MonitorQueryMetrics } from "./monitorQueryMetrics.spec"; + +type MonitorQueryTestOptions = Record; + +export class MetricsQueryTest extends MonitorQueryMetrics { + metricsUri: string; + metricNames: string[]; + aggregations: AggregationType[]; + public options: PerfStressOptionDictionary = {}; + constructor() { + super(); + this.metricsUri = getEnvVar("METRICS_RESOURCE_ID"); + this.metricNames = ["MatchedEventCount"]; + this.aggregations = ["Count"] + } + + async runAsync(): Promise { + await this.client.queryResource(this.metricsUri, this.metricNames, {aggregations: this.aggregations}); + + } +} \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts new file mode 100644 index 000000000000..b77339986814 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; +import { LogsQueryClient } from "@azure/monitor-query"; +import {DefaultAzureCredential} from "@azure/identity"; + +// Expects the .env file at the same level +import * as dotenv from "dotenv"; +dotenv.config(); + +export abstract class MetricsAdvisorTest extends PerfStressTest { + client:LogsQueryClient; + + constructor() { + super(); + const tokenCredential = new DefaultAzureCredential(); + this.client = new LogsQueryClient(tokenCredential); + } +} \ No newline at end of file diff --git a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts new file mode 100644 index 000000000000..c0c8fc4b76d3 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { MetricsQueryClient } from "@azure/monitor-query"; +import {DefaultAzureCredential} from "@azure/identity"; + +// Expects the .env file at the same level +import * as dotenv from "dotenv"; +dotenv.config(); + +export abstract class MetricsQueryTest extends PerfStressTest { + client:MetricsQueryClient; + + constructor() { + super(); + const tokenCredential = new DefaultAzureCredential(); + this.client = new MetricsQueryClient(tokenCredential); + } +} diff --git a/sdk/monitor/perf-tests/monitor-query/tsconfig.json b/sdk/monitor/perf-tests/monitor-query/tsconfig.json new file mode 100644 index 000000000000..9ed96938ac40 --- /dev/null +++ b/sdk/monitor/perf-tests/monitor-query/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../tsconfig.package", + "compilerOptions": { + "module": "CommonJS", + "lib": ["ES6", "ESNext.AsyncIterable"], + "noEmit": true + }, + "compileOnSave": true, + "include": ["./test/**/*.ts"] + } \ No newline at end of file From 05d1df882d22fdb2f044cc8879c429c16f8ea1ac Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 02:43:44 -0700 Subject: [PATCH 2/8] update tests and readme --- common/config/rush/pnpm-lock.yaml | 27 ++++++++++-- rush.json | 5 +++ .../perf-tests/monitor-query/README.md | 13 ++++++ .../monitor-query/test/logQuery.spec.ts | 11 +++-- .../monitor-query/test/logQueryBatch.spec.ts | 41 ++++++++++--------- 5 files changed, 70 insertions(+), 27 deletions(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index c17792e0b32f..0b17dfeacfc2 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -94,6 +94,7 @@ specifiers: '@rush-temp/perf-keyvault-certificates': file:./projects/perf-keyvault-certificates.tgz '@rush-temp/perf-keyvault-keys': file:./projects/perf-keyvault-keys.tgz '@rush-temp/perf-keyvault-secrets': file:./projects/perf-keyvault-secrets.tgz + '@rush-temp/perf-monitor-query': file:./projects/perf-monitor-query.tgz '@rush-temp/perf-search-documents': file:./projects/perf-search-documents.tgz '@rush-temp/perf-service-bus': file:./projects/perf-service-bus.tgz '@rush-temp/perf-storage-blob': file:./projects/perf-storage-blob.tgz @@ -223,6 +224,7 @@ dependencies: '@rush-temp/perf-keyvault-certificates': file:projects/perf-keyvault-certificates.tgz '@rush-temp/perf-keyvault-keys': file:projects/perf-keyvault-keys.tgz '@rush-temp/perf-keyvault-secrets': file:projects/perf-keyvault-secrets.tgz + '@rush-temp/perf-monitor-query': file:projects/perf-monitor-query.tgz '@rush-temp/perf-search-documents': file:projects/perf-search-documents.tgz '@rush-temp/perf-service-bus': file:projects/perf-service-bus.tgz '@rush-temp/perf-storage-blob': file:projects/perf-storage-blob.tgz @@ -633,7 +635,7 @@ packages: resolution: {integrity: sha512-Q71Buur3RMcg6lCnisLL8Im562DBw+ybzgm+YQj/FbAaI8ZNu/zl/5z1fE4k3Q9LSIzYrz6HLRzlhdSBXpydlQ==} engines: {node: '>=8.0.0'} dependencies: - '@azure/core-http': 1.2.3 + '@azure/core-http': 1.2.6 '@azure/core-tracing': 1.0.0-preview.9 '@azure/logger': 1.0.3 '@azure/msal-node': 1.0.0-beta.6_debug@4.3.2 @@ -3048,7 +3050,7 @@ packages: resolution: {integrity: sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==} deprecated: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) dependencies: - ms: 2.1.1 + ms: 2.1.3 dev: false /debug/3.2.7: @@ -11575,6 +11577,25 @@ packages: - supports-color dev: false + file:projects/perf-monitor-query.tgz: + resolution: {integrity: sha512-toEUj6i3XyxLZWIO8erTWaghQaQddo1Fqg5bXigfnfm1Ols9D49XWJlL1TkD4NN02MU04u0j6yYQu+dHSZ+SxQ==, tarball: file:projects/perf-monitor-query.tgz} + name: '@rush-temp/perf-monitor-query' + version: 0.0.0 + dependencies: + '@types/node': 12.20.27 + dotenv: 8.6.0 + eslint: 7.32.0 + prettier: 1.19.1 + rimraf: 3.0.2 + ts-node: 10.2.1_3c2c35653f239e2d026eed3c3359ac92 + tslib: 2.3.1 + typescript: 4.2.4 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + - supports-color + dev: false + file:projects/perf-search-documents.tgz: resolution: {integrity: sha512-JzZnuFWDzadcVL5Ch79lQLH2bLQbEGlh4m4RjmcE2FQMSUpyEeD6RsgRZjvdp9S1snhJgUHCnjNg8C/k/2GJzg==, tarball: file:projects/perf-search-documents.tgz} name: '@rush-temp/perf-search-documents' @@ -11927,7 +11948,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-Dj9zXeDcT7X3avSNb4fB2h21lQ/9+MDS/hty9X2ykdoF31dOgP35b8rWh/CbWJKC/ApK0CknW77zGHJctbvtgg==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: diff --git a/rush.json b/rush.json index d55ea3797916..b5c589b79b03 100644 --- a/rush.json +++ b/rush.json @@ -842,6 +842,11 @@ "projectFolder": "sdk/appconfiguration/perf-tests/app-configuration", "versionPolicyName": "test" }, + { + "packageName": "@azure-tests/perf-monitor-query", + "projectFolder": "sdk/monitor/perf-tests/monitor-query", + "versionPolicyName": "test" + }, { "packageName": "@azure/mixed-reality-remote-rendering", "projectFolder": "sdk/remoterendering/mixed-reality-remote-rendering", diff --git a/sdk/monitor/perf-tests/monitor-query/README.md b/sdk/monitor/perf-tests/monitor-query/README.md index e69de29bb2d1..654dd7d76974 100644 --- a/sdk/monitor/perf-tests/monitor-query/README.md +++ b/sdk/monitor/perf-tests/monitor-query/README.md @@ -0,0 +1,13 @@ +### Guide + +1. Build the monitor-query perf tests package `rush build -t perf-monitor-query`. +2. Copy the `sample.env` file and name it as `.env`. +3. Create log analytics workspace account and populate the `.env` file with the values of variables specified from the `sample.env` +4. Run the tests as follows: + +- metrics query + - `npm run perf-test:node -- MetricsQueryTest --warmup 1 --iterations 1 --parallel 50 --duration 15` +- log query + - `npm run perf-test:node -- LogQueryTest --warmup 1 --iterations 1 --parallel 50 --duration 15` +- log batch query + - `npm run perf-test:node -- LogQueryBatchTest --warmup 1 --iterations 1 --parallel 50 --duration 15` 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 461c5f327af3..d76aafa44071 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQuery.spec.ts @@ -12,11 +12,14 @@ export class LogQueryTest extends MonitorQueryLog { constructor() { super(); this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); - this.query = "AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId"; + this.query = + "AppRequests | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId"; } async runAsync(): Promise { - await this.client.queryWorkspace(this.workspaceId, this.query,{ startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } ); - + await this.client.queryWorkspace(this.workspaceId, this.query, { + startTime: new Date("2021-07-25"), + endTime: new Date("2021-07-26") + }); } -} \ No newline at end of file +} 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 d21b4f1c60a9..7630014a82e7 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/logQueryBatch.spec.ts @@ -2,7 +2,7 @@ // Licensed under the MIT license. import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; import { MonitorQueryLog } from "./monitorQueryLog.spec"; -import {QueryBatch} from "@azure/monitor-query"; +import { QueryBatch } from "@azure/monitor-query"; type MonitorQueryTestOptions = Record; @@ -13,27 +13,28 @@ export class LogQueryBatchTest extends MonitorQueryLog constructor() { super(); this.workspaceId = getEnvVar("MONITOR_WORKSPACE_ID"); - this.queryBatch =[ - { - workspaceId: this.workspaceId, - query: "AzureActivity | summarize count()", - timespan: { startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } - }, - { - workspaceId: this.workspaceId, - query: - "AppRequests | take 10 | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId", - timespan: { startTime: new Date("2021-07-25"),endTime: new Date("2021-07-26") } - }, - { - workspaceId: this.workspaceId, - query: "AppRequests | take 2", - includeQueryStatistics: true - } + this.queryBatch = [ + { + workspaceId: this.workspaceId, + query: "AzureActivity | summarize count()", + timespan: { startTime: new Date("2021-07-25"), endTime: new Date("2021-07-26") } + }, + { + workspaceId: this.workspaceId, + query: + "AppRequests | take 10 | summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId", + timespan: { startTime: new Date("2021-07-25"), endTime: new Date("2021-07-26") } + }, + { + workspaceId: this.workspaceId, + query: "AppRequests | take 2", + timespan: { duration: "" }, + includeQueryStatistics: true + } ]; } async runAsync(): Promise { - await this.client.queryBatch(this.queryBatch ); + await this.client.queryBatch(this.queryBatch); } -} \ No newline at end of file +} From a15af8b94b3ed06d5ab569d2800c9b4328bfded3 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 02:49:22 -0700 Subject: [PATCH 3/8] update --- .../perf-tests/monitor-query/test/index.spec.ts | 2 +- .../monitor-query/test/metricQuery.spec.ts | 11 ++++++----- .../monitor-query/test/monitorQueryLog.spec.ts | 12 ++++++------ .../monitor-query/test/monitorQueryMetrics.spec.ts | 8 ++++---- 4 files changed, 17 insertions(+), 16 deletions(-) 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 b8e763af1989..d581e2a242d0 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/index.spec.ts @@ -11,4 +11,4 @@ console.log("=== Starting the perfStress test ==="); const perfStressProgram = new PerfStressProgram( selectPerfStressTest([MetricsQueryTest, LogQueryBatchTest, LogQueryTest]) ); -perfStressProgram.run(); \ No newline at end of file +perfStressProgram.run(); 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 63388c07ad60..22a3d09e25cc 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. import { PerfStressOptionDictionary, getEnvVar } from "@azure/test-utils-perfstress"; -import {AggregationType} from "@azure/monitor-query"; +import { AggregationType } from "@azure/monitor-query"; import { MonitorQueryMetrics } from "./monitorQueryMetrics.spec"; type MonitorQueryTestOptions = Record; @@ -15,11 +15,12 @@ export class MetricsQueryTest extends MonitorQueryMetrics { - await this.client.queryResource(this.metricsUri, this.metricNames, {aggregations: this.aggregations}); - + await this.client.queryResource(this.metricsUri, this.metricNames, { + aggregations: this.aggregations + }); } -} \ No newline at end of file +} 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 b77339986814..c4023c679441 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryLog.spec.ts @@ -1,20 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PerfStressTest, getEnvVar } from "@azure/test-utils-perfstress"; -import { LogsQueryClient } from "@azure/monitor-query"; -import {DefaultAzureCredential} from "@azure/identity"; +import { PerfStressTest } from "@azure/test-utils-perfstress"; +import { LogsQueryClient } from "@azure/monitor-query"; +import { DefaultAzureCredential } from "@azure/identity"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class MetricsAdvisorTest extends PerfStressTest { - client:LogsQueryClient; +export abstract class MonitorQueryLog extends PerfStressTest { + client: LogsQueryClient; constructor() { super(); const tokenCredential = new DefaultAzureCredential(); this.client = new LogsQueryClient(tokenCredential); } -} \ No newline at end of file +} 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 c0c8fc4b76d3..07dfc433b8d7 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/monitorQueryMetrics.spec.ts @@ -2,15 +2,15 @@ // Licensed under the MIT license. import { PerfStressTest } from "@azure/test-utils-perfstress"; -import { MetricsQueryClient } from "@azure/monitor-query"; -import {DefaultAzureCredential} from "@azure/identity"; +import { MetricsQueryClient } from "@azure/monitor-query"; +import { DefaultAzureCredential } from "@azure/identity"; // Expects the .env file at the same level import * as dotenv from "dotenv"; dotenv.config(); -export abstract class MetricsQueryTest extends PerfStressTest { - client:MetricsQueryClient; +export abstract class MonitorQueryMetrics extends PerfStressTest { + client: MetricsQueryClient; constructor() { super(); From 1fb0f9ac1a835675cadd413cbc38ef47194039c2 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 03:01:52 -0700 Subject: [PATCH 4/8] update metric name --- sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 22a3d09e25cc..37dbf42fdf53 100644 --- a/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts +++ b/sdk/monitor/perf-tests/monitor-query/test/metricQuery.spec.ts @@ -14,7 +14,7 @@ export class MetricsQueryTest extends MonitorQueryMetrics Date: Wed, 6 Oct 2021 10:20:14 -0700 Subject: [PATCH 5/8] format --- .../perf-tests/monitor-query/package.json | 94 +++++++++---------- .../perf-tests/monitor-query/tsconfig.json | 18 ++-- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/sdk/monitor/perf-tests/monitor-query/package.json b/sdk/monitor/perf-tests/monitor-query/package.json index 404ff6ead743..96a70e09ec0f 100644 --- a/sdk/monitor/perf-tests/monitor-query/package.json +++ b/sdk/monitor/perf-tests/monitor-query/package.json @@ -1,48 +1,48 @@ { - "name": "@azure-tests/perf-monitor-query", - "sdk-type": "perf-test", - "version": "1.0.0", - "description": "", - "main": "", - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "@azure/monitor-query": "1.0.0-beta.6", - "@azure/test-utils-perfstress": "^1.0.0", - "dotenv": "^8.2.0", - "@azure/identity": "2.0.0-beta.7" - }, - "devDependencies": { - "@types/node": "^12.0.0", - "eslint": "^7.15.0", - "prettier": "^1.16.4", - "rimraf": "^3.0.0", - "tslib": "^2.2.0", - "ts-node": "^10.0.0", - "typescript": "~4.2.0" - }, - "private": true, - "scripts": { - "perf-test:node": "ts-node test/index.spec.ts", - "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", - "build": "npm run clean && tsc -p .", - "build:samples": "echo skipped", - "build:test": "echo skipped", - "check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "clean": "rimraf dist dist-esm test-dist types *.tgz *.log", - "format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "echo skipped", - "lint:fix": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts --fix --fix-type [problem,suggestion]", - "lint": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts", - "pack": "npm pack 2>&1", - "unit-test:browser": "echo skipped", - "unit-test:node": "echo skipped", - "unit-test": "echo skipped", - "test:browser": "echo skipped", - "test:node": "echo skipped", - "test": "echo skipped" - } - } \ No newline at end of file + "name": "@azure-tests/perf-monitor-query", + "sdk-type": "perf-test", + "version": "1.0.0", + "description": "", + "main": "", + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "@azure/monitor-query": "1.0.0-beta.6", + "@azure/test-utils-perfstress": "^1.0.0", + "dotenv": "^8.2.0", + "@azure/identity": "2.0.0-beta.7" + }, + "devDependencies": { + "@types/node": "^12.0.0", + "eslint": "^7.15.0", + "prettier": "^1.16.4", + "rimraf": "^3.0.0", + "tslib": "^2.2.0", + "ts-node": "^10.0.0", + "typescript": "~4.2.0" + }, + "private": true, + "scripts": { + "perf-test:node": "ts-node test/index.spec.ts", + "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit", + "build": "npm run clean && tsc -p .", + "build:samples": "echo skipped", + "build:test": "echo skipped", + "check-format": "prettier --list-different --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "clean": "rimraf dist dist-esm test-dist types *.tgz *.log", + "format": "prettier --write --config ../../../../.prettierrc.json --ignore-path ../../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", + "lint:fix": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts --fix --fix-type [problem,suggestion]", + "lint": "eslint --no-eslintrc -c ../../../.eslintrc.internal.json package.json test --ext .ts", + "pack": "npm pack 2>&1", + "unit-test:browser": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test": "echo skipped", + "test:browser": "echo skipped", + "test:node": "echo skipped", + "test": "echo skipped" + } +} diff --git a/sdk/monitor/perf-tests/monitor-query/tsconfig.json b/sdk/monitor/perf-tests/monitor-query/tsconfig.json index 9ed96938ac40..aff3fa45a140 100644 --- a/sdk/monitor/perf-tests/monitor-query/tsconfig.json +++ b/sdk/monitor/perf-tests/monitor-query/tsconfig.json @@ -1,10 +1,10 @@ { - "extends": "../../../../tsconfig.package", - "compilerOptions": { - "module": "CommonJS", - "lib": ["ES6", "ESNext.AsyncIterable"], - "noEmit": true - }, - "compileOnSave": true, - "include": ["./test/**/*.ts"] - } \ No newline at end of file + "extends": "../../../../tsconfig.package", + "compilerOptions": { + "module": "CommonJS", + "lib": ["ES6", "ESNext.AsyncIterable"], + "noEmit": true + }, + "compileOnSave": true, + "include": ["./test/**/*.ts"] +} From a709bc80e5ccdb8e96eb1a1f9063063ad42cab81 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 10:30:35 -0700 Subject: [PATCH 6/8] switch to previous sha --- common/config/rush/pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0b17dfeacfc2..577975500819 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11948,7 +11948,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: sha512-Dj9zXeDcT7X3avSNb4fB2h21lQ/9+MDS/hty9X2ykdoF31dOgP35b8rWh/CbWJKC/ApK0CknW77zGHJctbvtgg==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: 4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: From 0c6e45ec130b5a8eaca272e749d712c11f90e963 Mon Sep 17 00:00:00 2001 From: Karishma Ghiya Date: Wed, 6 Oct 2021 10:31:08 -0700 Subject: [PATCH 7/8] switch to previous sha --- common/config/rush/pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 577975500819..b22750513e52 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11948,7 +11948,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: 4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: 4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: From 3bbe799f2f8918a067c08a614e64529eb530398f Mon Sep 17 00:00:00 2001 From: KarishmaGhiya Date: Wed, 6 Oct 2021 10:32:23 -0700 Subject: [PATCH 8/8] Update common/config/rush/pnpm-lock.yaml --- common/config/rush/pnpm-lock.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index b22750513e52..49853c433067 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -11948,7 +11948,7 @@ packages: dev: false file:projects/schema-registry-avro.tgz: - resolution: {integrity: 4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A==, tarball: file:projects/schema-registry-avro.tgz} + resolution: {integrity: sha512-4wULpLuLiMk7+loAe+RwRq6u0i6mPpBa5tfSgnso/gWqPQpMh+UfNseudJInXH0KXwTZMwvkwjQCP/dwvkeG4A==, tarball: file:projects/schema-registry-avro.tgz} name: '@rush-temp/schema-registry-avro' version: 0.0.0 dependencies: