Use labels.Len() instead of manually counting the labels

Signed-off-by: gotjosh <josue.abreu@gmail.com>
pull/13980/head
gotjosh 7 months ago
parent ccfafae36d
commit 63b09944b8
No known key found for this signature in database
GPG Key ID: A6E1DDE38FF3C74E

@ -711,16 +711,12 @@ func TestQueryForStateSeries(t *testing.T) {
)
sample := rule.forStateSample(nil, time.Time{}, 0)
var matchersCount int
sample.Metric.Range(func(l labels.Label) {
matchersCount++
})
seriesSet, err := rule.QueryForStateSeries(context.Background(), querier)
var series storage.Series
for seriesSet.Next() {
if seriesSet.At().Labels().Len() == matchersCount {
if seriesSet.At().Labels().Len() == sample.Metric.Len() {
series = seriesSet.At()
break
}

Loading…
Cancel
Save