scheduler-perf: measure workload runtime and relabel workloads

The goal is to only label workloads as "performance" which actually run long
enough to provide useful metrics. The throughput collector samples once per
second, so a workload should run at least 5, better 10 seconds to get at least
a minimal amount of samples for the percentile calculation.

For benchstat analysis of runs with sufficient repetitions to get statistically
meaningful results, each workload shouldn't run more than one minute, otherwise
before/after analysis becomes too slow.

The labels were chosen based on benchmark runs on a reasonably fast desktop. To
know how long each workload takes, a new "runtime_seconds" benchmark result
gets added.
This commit is contained in:
Patrick Ohly
2023-05-05 17:35:57 +02:00
parent 7e25f1232a
commit d85b91f343
2 changed files with 52 additions and 8 deletions

View File

@@ -748,6 +748,15 @@ func unrollWorkloadTemplate(b *testing.B, wt []op, w *workload) []op {
}
func runWorkload(ctx context.Context, b *testing.B, tc *testCase, w *workload) []DataItem {
start := time.Now()
b.Cleanup(func() {
duration := time.Now().Sub(start)
// This includes startup and shutdown time and thus does not
// reflect scheduling performance. It's useful to get a feeling
// for how long each workload runs overall.
b.ReportMetric(duration.Seconds(), "runtime_seconds")
})
var cfg *config.KubeSchedulerConfiguration
var err error
if tc.SchedulerConfigPath != nil {