MCPcopy Create free account
hub / github.com/cortexproject/cortex / PostDeletion

Method PostDeletion

pkg/ingester/ingester.go:561–576  ·  view source on GitHub ↗

PostDeletion implements SeriesLifecycleCallback interface.

(metrics map[chunks.HeadSeriesRef]labels.Labels)

Source from the content-addressed store, hash-verified

559
560// PostDeletion implements SeriesLifecycleCallback interface.
561func (u *userTSDB) PostDeletion(metrics map[chunks.HeadSeriesRef]labels.Labels) {
562 u.instanceSeriesCount.Sub(int64(len(metrics)))
563
564 for _, metric := range metrics {
565 metricName, err := extract.MetricNameFromLabels(metric)
566 if err != nil {
567 // This should never happen because it has already been checked in PreCreation().
568 continue
569 }
570 u.seriesInMetric.decreaseSeriesForMetric(metricName)
571 u.labelSetCounter.decreaseSeriesLabelSet(u, metric)
572 if u.postingCache != nil {
573 u.postingCache.ExpireSeries(metric)
574 }
575 }
576}
577
578// blocksToDelete filters the input blocks and returns the blocks which are safe to be deleted from the ingester.
579func (u *userTSDB) blocksToDelete(blocks []*tsdb.Block) map[ulid.ULID]struct{} {

Callers

nothing calls this directly

Calls 4

MetricNameFromLabelsFunction · 0.92
ExpireSeriesMethod · 0.65

Tested by

no test coverage detected