Skip to content

Commit 75711ed

Browse files
nikola-jokicj8169mauriceyapdejanzele
authored
Fix metric label for phase from uppercase to titlecase (#4685)
<!-- Thanks for sending a pull request! Here are some tips for you: --> #### What type of PR is this? Fix #### What this PR does / why we need it Have a same label value across metrics --------- Signed-off-by: Nikola Jokic <jokicnikola07@gmail.com> Co-authored-by: John Popplewell <john.popplewell@gresearch.co.uk> Co-authored-by: Maurice Yap <mauriceyap@hotmail.co.uk> Co-authored-by: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
1 parent 7929e74 commit 75711ed

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

internal/scheduler/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func (c *MetricsCollector) updateClusterMetrics(ctx *armadacontext.Context) ([]p
443443
nodeJobsMetricCounts[nodeJobPhaseMetricKey{
444444
node: node.Name,
445445
cluster: executor.Id,
446-
phase: phase,
446+
phase: strings.Title(strings.ToLower(phase)),
447447
}]++
448448
}
449449

internal/scheduler/metrics_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ func TestMetricsCollector_TestCollect_ClusterMetrics(t *testing.T) {
348348
commonmetrics.NewPoolInfoMetric(testfixtures.TestPool),
349349
commonmetrics.NewQueueLeasedPodCount(1, "cluster-1", testfixtures.TestPool, testfixtures.TestQueue, "Pending", "type-1", "none"),
350350
commonmetrics.NewQueueLeasedPodCount(1, "cluster-1", testfixtures.TestPool, testfixtures.TestQueue, "Running", "type-1", "none"),
351-
commonmetrics.NewNodeJobPhaseCountMetric(1, nodeWithJobs.Name, "cluster-1", "PENDING"),
352-
commonmetrics.NewNodeJobPhaseCountMetric(1, nodeWithJobs.Name, "cluster-1", "RUNNING"),
351+
commonmetrics.NewNodeJobPhaseCountMetric(1, nodeWithJobs.Name, "cluster-1", "Pending"),
352+
commonmetrics.NewNodeJobPhaseCountMetric(1, nodeWithJobs.Name, "cluster-1", "Running"),
353353
commonmetrics.NewQueueAllocated(2, testfixtures.TestQueue, "cluster-1", testfixtures.TestPool, testfixtures.TestDefaultPriorityClass, "None", "cpu", "type-1", "none"),
354354
commonmetrics.NewQueueAllocated(2*1024*1024*1024, testfixtures.TestQueue, "cluster-1", testfixtures.TestPool, testfixtures.TestDefaultPriorityClass, "None", "memory", "type-1", "none"),
355355
commonmetrics.NewQueueUsed(1, testfixtures.TestQueue, "cluster-1", testfixtures.TestPool, "cpu", "type-1", "none"),

0 commit comments

Comments
 (0)