mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
tsdb: use abstractions over Labels
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
9bb9faabb1
commit
2e22653db4
|
@ -1176,13 +1176,17 @@ func (c *LeveledCompactor) populateSymbols(sets []storage.ChunkSeriesSet, outBlo
|
|||
obIx = labels.StableHash(s.Labels()) % uint64(len(outBlocks))
|
||||
}
|
||||
|
||||
for _, l := range s.Labels() {
|
||||
err := s.Labels().Validate(func(l labels.Label) error {
|
||||
if err := batchers[obIx].addSymbol(l.Name); err != nil {
|
||||
return errors.Wrap(err, "addSymbol to batcher")
|
||||
}
|
||||
if err := batchers[obIx].addSymbol(l.Value); err != nil {
|
||||
return errors.Wrap(err, "addSymbol to batcher")
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -596,10 +596,10 @@ func TestCompaction_CompactWithSplitting(t *testing.T) {
|
|||
require.Equal(t, uint64(shardIndex), lbls.Labels().Hash()%shardCount)
|
||||
|
||||
// Collect all symbols used by series.
|
||||
for _, l := range lbls.Labels() {
|
||||
lbls.Labels().Range(func(l labels.Label) {
|
||||
seriesSymbols[l.Name] = struct{}{}
|
||||
seriesSymbols[l.Value] = struct{}{}
|
||||
}
|
||||
})
|
||||
}
|
||||
require.NoError(t, p.Err())
|
||||
|
||||
|
|
Loading…
Reference in a new issue