mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Update package tsdb/test for new labels.Labels type
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
14ad2e780b
commit
f0ec81badd
|
@ -58,9 +58,7 @@ func BenchmarkLabelsClone(b *testing.B) {
|
|||
l := labels.FromMap(m)
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
res := make(labels.Labels, len(l))
|
||||
copy(res, l)
|
||||
l = res
|
||||
l = l.Copy()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,13 +104,13 @@ func BenchmarkLabelSetAccess(b *testing.B) {
|
|||
|
||||
var v string
|
||||
|
||||
for _, l := range ls {
|
||||
ls.Range(func(l labels.Label) {
|
||||
b.Run(l.Name, func(b *testing.B) {
|
||||
for i := 0; i < b.N; i++ {
|
||||
v = ls.Get(l.Name)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
_ = v
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue