Skip to content

Commit

Permalink
Update Performance Counter Names (#1325)
Browse files Browse the repository at this point in the history
* Update performance counter names.

* Update perf counter tests.
  • Loading branch information
JacksonWeber committed May 10, 2024
1 parent cbd15ec commit 7c8e2ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/metrics/types.ts
Expand Up @@ -33,10 +33,10 @@ export enum StandardMetricNames {
}

export enum PerformanceCounterMetricNames {
PRIVATE_BYTES = "\\Process(??APP_WIN32_PROC??)\\Private Bytes",
AVAILABLE_BYTES = "\\Memory\\Available Bytes",
PROCESSOR_TIME = "\\Processor(_Total)\\% Processor Time",
PROCESS_TIME = "\\Process(??APP_WIN32_PROC??)\\% Processor Time",
REQUEST_RATE = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec",
REQUEST_DURATION = "\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time",
PRIVATE_BYTES = "Private_Bytes",
AVAILABLE_BYTES = "Available_Bytes",
PROCESSOR_TIME = "Processor_Time",
PROCESS_TIME = "Process_Time",
REQUEST_RATE = "Request_Rate",
REQUEST_DURATION = "Request_Execution_Time",
}
12 changes: 6 additions & 6 deletions test/unitTests/metrics/performanceCounters.tests.ts
Expand Up @@ -73,7 +73,7 @@ describe("PerformanceCounterMetricsHandler", () => {

assert.deepStrictEqual(
metrics[0].descriptor.name,
"\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"
"Request_Execution_Time"
);
assert.strictEqual(metrics[0].dataPoints.length, 1, "dataPoints count");
assert.strictEqual((metrics[0].dataPoints[0].value as Histogram).count, 10, "dataPoint count");
Expand All @@ -83,25 +83,25 @@ describe("PerformanceCounterMetricsHandler", () => {

assert.deepStrictEqual(
metrics[1].descriptor.name,
"\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec"
"Request_Rate"
);
assert.ok(metrics[1].dataPoints[0].value> 0, "Wrong request rate value");

assert.deepStrictEqual(
metrics[2].descriptor.name,
"\\Process(??APP_WIN32_PROC??)\\Private Bytes"
"Private_Bytes"
);
assert.ok(metrics[2].dataPoints[0].value > 0, "Wrong private bytes value");
assert.deepStrictEqual(metrics[3].descriptor.name, "\\Memory\\Available Bytes");
assert.deepStrictEqual(metrics[3].descriptor.name, "Available_Bytes");
assert.ok(metrics[3].dataPoints[0].value > 0, "Wrong available bytes value");
assert.deepStrictEqual(metrics[4].descriptor.name, "\\Processor(_Total)\\% Processor Time");
assert.deepStrictEqual(metrics[4].descriptor.name, "Processor_Time");
assert.ok(
metrics[4].dataPoints[0].value >= 0 && metrics[4].dataPoints[0].value <= 100,
`Wrong Processor Time value: ${metrics[4].dataPoints[0].value}`
);
assert.deepStrictEqual(
metrics[5].descriptor.name,
"\\Process(??APP_WIN32_PROC??)\\% Processor Time"
"Process_Time"
);
assert.ok(
metrics[5].dataPoints[0].value >= 0 && metrics[5].dataPoints[0].value <= 100,
Expand Down

0 comments on commit 7c8e2ac

Please sign in to comment.