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 diff --git a/test/integration/scheduler_perf/util.go b/test/integration/scheduler_perf/util.go index 79bc3ab10bb..327f1dd4310 100644 --- a/test/integration/scheduler_perf/util.go +++ b/test/integration/scheduler_perf/util.go @@ -196,6 +196,27 @@ func makeBasePod() *v1.Pod { } func dataItems2JSONFile(dataItems DataItems, namePrefix string) error { + // perfdash expects all data items to have the same set of labels. It + // then renders drop-down buttons for each label with all values found + // for each label. If we were to store data items that don't have a + // certain label, then perfdash will never show those data items + // because it will only show data items that have the currently + // selected label value. To avoid that, we collect all labels used + // anywhere and then add missing labels with "not applicable" as value. + labels := sets.New[string]() + for _, item := range dataItems.DataItems { + for label := range item.Labels { + labels.Insert(label) + } + } + for _, item := range dataItems.DataItems { + for label := range labels { + if _, ok := item.Labels[label]; !ok { + item.Labels[label] = "not applicable" + } + } + } + b, err := json.Marshal(dataItems) if err != nil { return err