From 29e5771aa4d3996c226312fc21c09e7f81ab31f4 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Mon, 3 Jul 2023 21:15:16 +0200 Subject: [PATCH] scheduler-perf: shorten "Name" label in metrics Because the JSON file gets written at the end of the top-level benchmark, all data items had `BenchmarkPerfScheduling/` as prefix in the `Name` label. This is redundant and makes it harder to see the actual name. Now that common prefix gets removed. --- test/integration/scheduler_perf/scheduler_perf_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/scheduler_perf/scheduler_perf_test.go b/test/integration/scheduler_perf/scheduler_perf_test.go index ecbfce6887b..8671b6381ce 100644 --- a/test/integration/scheduler_perf/scheduler_perf_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_test.go @@ -996,7 +996,10 @@ func runWorkload(ctx context.Context, tb testing.TB, tc *testCase, w *workload, if concreteOp.CollectMetrics { collectorCtx, collectorCancel = context.WithCancel(ctx) defer collectorCancel() - collectors = getTestDataCollectors(tb, podInformer, fmt.Sprintf("%s/%s", tb.Name(), namespace), namespace, tc.MetricsCollectorConfig, throughputErrorMargin) + name := tb.Name() + // The first part is the same for each work load, therefore we can strip it. + name = name[strings.Index(name, "/")+1:] + collectors = getTestDataCollectors(tb, podInformer, fmt.Sprintf("%s/%s", name, namespace), namespace, tc.MetricsCollectorConfig, throughputErrorMargin) for _, collector := range collectors { // Need loop-local variable for function below. collector := collector