MCPcopy Index your code
hub / github.com/prometheus/prometheus / StoreSeries

Method StoreSeries

storage/remote/queue_manager.go:1010–1029  ·  view source on GitHub ↗

StoreSeries keeps track of which series we know about for lookups when sending samples to remote.

(series []record.RefSeries, index int)

Source from the content-addressed store, hash-verified

1008
1009// StoreSeries keeps track of which series we know about for lookups when sending samples to remote.
1010func (t *QueueManager) StoreSeries(series []record.RefSeries, index int) {
1011 t.seriesMtx.Lock()
1012 defer t.seriesMtx.Unlock()
1013 t.seriesSegmentMtx.Lock()
1014 defer t.seriesSegmentMtx.Unlock()
1015 for _, s := range series {
1016 // Just make sure all the Refs of Series will insert into seriesSegmentIndexes map for tracking.
1017 t.seriesSegmentIndexes[s.Ref] = index
1018
1019 t.builder.Reset(s.Labels)
1020 processExternalLabels(t.builder, t.externalLabels)
1021 keep := relabel.ProcessBuilder(t.builder, t.relabelConfigs...)
1022 if !keep {
1023 t.droppedSeries[s.Ref] = struct{}{}
1024 continue
1025 }
1026 lbls := t.builder.Labels()
1027 t.seriesLabels[s.Ref] = lbls
1028 }
1029}
1030
1031// StoreMetadata keeps track of known series' metadata for lookups when sending samples to remote.
1032func (t *QueueManager) StoreMetadata(meta []record.RefMetadata) {

Callers 2

BenchmarkStoreSeriesFunction · 0.95

Calls 5

ProcessBuilderFunction · 0.92
processExternalLabelsFunction · 0.85
LockMethod · 0.80
ResetMethod · 0.65
LabelsMethod · 0.65

Tested by 2

BenchmarkStoreSeriesFunction · 0.76