mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
[Test] TSDB: let BenchmarkAddExemplar reuse slots
Test with different amounts of capacity and exemplars, so that sometimes new exemplars are evicting older exemplars. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
6683895620
commit
929fbf860e
|
@ -415,11 +415,12 @@ func BenchmarkAddExemplar(b *testing.B) {
|
|||
// before adding.
|
||||
exLabels := labels.FromStrings("trace_id", "89620921")
|
||||
|
||||
for _, capacity := range []int{1000, 10000, 100000} {
|
||||
for _, n := range []int{10000, 100000, 1000000} {
|
||||
b.Run(strconv.Itoa(n), func(b *testing.B) {
|
||||
b.Run(fmt.Sprintf("%d/%d", n, capacity), func(b *testing.B) {
|
||||
for j := 0; j < b.N; j++ {
|
||||
b.StopTimer()
|
||||
exs, err := NewCircularExemplarStorage(int64(n), eMetrics)
|
||||
exs, err := NewCircularExemplarStorage(int64(capacity), eMetrics)
|
||||
require.NoError(b, err)
|
||||
es := exs.(*CircularExemplarStorage)
|
||||
var l labels.Labels
|
||||
|
@ -438,6 +439,7 @@ func BenchmarkAddExemplar(b *testing.B) {
|
|||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkResizeExemplars(b *testing.B) {
|
||||
testCases := []struct {
|
||||
|
|
Loading…
Reference in a new issue