From fd5eb09f9574dbf93151f33728bf7cddd4334798 Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Thu, 21 Mar 2024 18:34:48 +0000 Subject: [PATCH] Sleep before collecting metrics --- cmd/apmbench/run.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmd/apmbench/run.go b/cmd/apmbench/run.go index 7c6f98d..ae1b646 100644 --- a/cmd/apmbench/run.go +++ b/cmd/apmbench/run.go @@ -91,13 +91,6 @@ func Run( return fmt.Errorf("benchmark %q failed", name) } fmt.Printf("%-*s\t%s\n", maxLen, name, result.benchResult) - // Sleep to allow any remaining data to be consumed by the pipelines - // so that they don't pollute the result of the next benchmark run. - // - // TODO (lahsivjar): Make this deterministic by introducing cleanup - // metrics. We can watch the cleanup metrics to reach to a specified - // threshold and then run the next benchmark. - time.Sleep(time.Minute) } } } @@ -126,6 +119,15 @@ func runOne( result.skipped = b.Skipped() result.failed = b.Failed() + + // Sleep to allow any remaining data to be consumed by the pipelines + // so that they don't pollute the result of the next benchmark run. + // + // TODO (lahsivjar): Make this deterministic by introducing cleanup + // metrics. We can watch the cleanup metrics to reach to a specified + // threshold and then run the next benchmark. + time.Sleep(time.Minute) + extraMetrics(b) }) return result