native histogram: use exemplars in concurrency test

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
This commit is contained in:
György Krajcsovits 2024-08-31 10:27:18 +02:00
parent 67121dc55a
commit e061dfae88
1 changed files with 6 additions and 2 deletions

View File

@ -1049,10 +1049,14 @@ func TestNativeHistogramConcurrency(t *testing.T) {
go func(vals []float64) { go func(vals []float64) {
start.Wait() start.Wait()
for _, v := range vals { for i, v := range vals {
// An observation every 1 to 10 seconds. // An observation every 1 to 10 seconds.
atomic.AddInt64(&ts, rand.Int63n(10)+1) atomic.AddInt64(&ts, rand.Int63n(10)+1)
his.Observe(v) if i%2 == 0 {
his.Observe(v)
} else {
his.(ExemplarObserver).ObserveWithExemplar(v, Labels{"foo": "bar"})
}
} }
end.Done() end.Done()
}(vals) }(vals)