Skip to content

Commit 8b29e48

Browse files
committed
roachtest/allocbench: Add labels to the std-dev metric
Adds unit and is_higher_better tags to std-dev metrics being emitted from allocbench tests. Epic: none Fixes: none
1 parent 089c226 commit 8b29e48

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

pkg/cmd/roachtest/tests/allocation_bench.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,20 @@ func runAllocationBench(
351351
// worst/best case outcomes.
352352
result, sampleStddev := findMinDistanceClusterStatRun(t, samples)
353353
for tag, value := range sampleStddev {
354-
result.Total[fmt.Sprintf("std_%s", tag)] = value
354+
metricName := fmt.Sprintf("std_%s", tag)
355+
result.Total[metricName] = value
356+
357+
// Populate BenchmarkMetrics with metadata if it's initialized
358+
// (it will be initialized only when OpenMetrics is enabled)
359+
if result.BenchmarkMetrics != nil {
360+
result.BenchmarkMetrics[metricName] = roachtestutil.AggregatedMetric{
361+
Name: metricName,
362+
Value: roachtestutil.MetricPoint(value),
363+
Unit: "stddev",
364+
IsHigherBetter: false, // Lower standard deviation is better
365+
AdditionalLabels: nil,
366+
}
367+
}
355368
}
356369
if result == nil {
357370
t.L().PrintfCtx(ctx, "no samples found for allocation bench run, won't put any artifacts")

0 commit comments

Comments
 (0)