PostDeletion implements SeriesLifecycleCallback interface.
(metrics map[chunks.HeadSeriesRef]labels.Labels)
| 559 | |
| 560 | // PostDeletion implements SeriesLifecycleCallback interface. |
| 561 | func (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. |
| 579 | func (u *userTSDB) blocksToDelete(blocks []*tsdb.Block) map[ulid.ULID]struct{} { |
nothing calls this directly
no test coverage detected