Skip to content

Commit a845c0e

Browse files
authored
fix(glue): fixed wrong unit for cpu/heap usage (#168)
Fixes #159 --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 55ecbf5 commit a845c0e

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

lib/monitoring/aws-glue/GlueJobMetricFactory.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,29 @@ export class GlueJobMetricFactory {
5555
}
5656

5757
metricAverageExecutorCpuUsagePercentage() {
58-
return this.metricFactory.createMetric(
58+
const label = "CPU Usage (executor average)";
59+
const metric = this.metricFactory.createMetric(
5960
"glue.ALL.system.cpuSystemLoad",
6061
MetricStatistic.AVERAGE,
61-
"CPU Usage (executor average)",
62+
label,
6263
this.dimensionsMap,
6364
undefined,
6465
GlueNamespace
6566
);
67+
return this.metricFactory.multiplyMetric(metric, 100, label, "cpu");
6668
}
6769

6870
metricAverageExecutorMemoryUsagePercentage() {
69-
return this.metricFactory.createMetric(
71+
const label = "JVM Heap usage (executor average)";
72+
const metric = this.metricFactory.createMetric(
7073
"glue.ALL.jvm.heap.usage",
7174
MetricStatistic.AVERAGE,
72-
"JVM Heap usage (executor average)",
75+
label,
7376
this.dimensionsMap,
7477
undefined,
7578
GlueNamespace
7679
);
80+
return this.metricFactory.multiplyMetric(metric, 100, label, "heap");
7781
}
7882

7983
metricActiveExecutorsAverage() {

test/facade/__snapshots__/MonitoringAspect.test.ts.snap

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/monitoring/aws-glue/__snapshots__/GlueJobMonitoring.test.ts.snap

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)