mirror of
https://github.com/prometheus/prometheus.git
synced 2026-02-03 20:39:32 -05:00
[TESTS] Scraping: Reset appender in BenchmarkScrapeLoopAppend
Otherwise performance is dominated by adding to a slice that gets longer and longer as the benchmark progresses. I chose to Rollback rather than Commit because that should do less work. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
c4b0da94db
commit
2dec6da3d1
1 changed files with 2 additions and 0 deletions
|
|
@ -1384,6 +1384,8 @@ func BenchmarkScrapeLoopAppend(b *testing.B) {
|
|||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
app.Rollback() // Reset the appender so it doesn't grow indefinitely.
|
||||
app = sl.appender()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue