Skip to content

Commit

Permalink
Use count config for apmbench (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar authored Sep 5, 2023
1 parent 4ce0d0c commit 9bae57c
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions cmd/apmbench/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,25 +76,27 @@ func Run(
runtime.GOMAXPROCS(agents)
for _, b := range benchmarks {
name := fullBenchmarkName(b.name, agents)
result := runOne(extraMetrics, resetStore, b.fn)
// testing.Benchmark discards all output so the only thing we can
// retrive is the benchmark status and result.
if result.skipped {
fmt.Printf("--- SKIP: %s\n", name)
continue
for i := 0; i < int(cfg.Count); i++ {
result := runOne(extraMetrics, resetStore, b.fn)
// testing.Benchmark discards all output so the only thing we can
// retrive is the benchmark status and result.
if result.skipped {
fmt.Printf("--- SKIP: %s\n", name)
continue
}
if result.failed {
fmt.Printf("--- FAIL: %s\n", name)
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)
}
if result.failed {
fmt.Printf("--- FAIL: %s\n", name)
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)
}
}
return nil
Expand Down

0 comments on commit 9bae57c

Please sign in to comment.