Skip to content

Commit

Permalink
Sleep before collecting metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar committed Mar 21, 2024
1 parent 0497fdf commit fd5eb09
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmd/apmbench/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fd5eb09

Please sign in to comment.