Skip to content

Commit

Permalink
fix number of metrics assertion in testMetricManager
Browse files Browse the repository at this point in the history
  • Loading branch information
Rony Leppänen committed Nov 26, 2024
1 parent aa96f2f commit a26eefb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,9 @@ public void testMetricManager() throws JsonParseException, InterruptedException
// Define expected metrics
// See ts/metrics/system_metrics.py, ts/configs/metrics.yaml
Map<String, Map<String, String>> expectedMetrics = new HashMap<>();
expectedMetrics.put("GPUMemoryUtilization", Map.of(UNIT, "Percent", LEVEL, HOST));
expectedMetrics.put("GPUMemoryUsed", Map.of(UNIT, "Megabytes", LEVEL, HOST));
expectedMetrics.put("GPUUtilization", Map.of(UNIT, "Percent", LEVEL, HOST));
expectedMetrics.put("CPUUtilization", Map.of(UNIT, "Percent", LEVEL, HOST));
expectedMetrics.put("MemoryUsed", Map.of(UNIT, "Megabytes", LEVEL, HOST));
expectedMetrics.put("MemoryAvailable", Map.of(UNIT, "Megabytes", LEVEL, HOST));
Expand All @@ -1369,7 +1372,8 @@ public void testMetricManager() throws JsonParseException, InterruptedException
Assert.assertTrue(++count < 5);
}

Assert.assertEquals(metrics.size(), expectedMetrics.size());
// 7 system-level metrics + 3 gpu-specific metrics
Assert.assertEquals(metrics.size(), 7 + 3 * configManager.getNumberOfGpu());

for (Metric metric : metrics) {
String metricName = metric.getMetricName();
Expand Down

0 comments on commit a26eefb

Please sign in to comment.