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

Method updateBucketMetrics

pkg/compactor/blocks_cleaner.go:765–781  ·  view source on GitHub ↗
(userID string, parquetEnabled bool, idx *bucketindex.Index, partials, totalBlocksBlocksMarkedForNoCompaction float64)

Source from the content-addressed store, hash-verified

763}
764
765func (c *BlocksCleaner) updateBucketMetrics(userID string, parquetEnabled bool, idx *bucketindex.Index, partials, totalBlocksBlocksMarkedForNoCompaction float64) {
766 c.tenantBlocks.WithLabelValues(userID).Set(float64(len(idx.Blocks)))
767 c.tenantBlocksMarkedForDelete.WithLabelValues(userID).Set(float64(len(idx.BlockDeletionMarks)))
768 c.tenantBlocksMarkedForNoCompaction.WithLabelValues(userID).Set(totalBlocksBlocksMarkedForNoCompaction)
769 c.tenantPartialBlocks.WithLabelValues(userID).Set(float64(partials))
770 c.tenantBucketIndexLastUpdate.WithLabelValues(userID).SetToCurrentTime()
771 if parquetEnabled {
772 c.tenantParquetBlocks.WithLabelValues(userID).Set(float64(len(idx.ParquetBlocks())))
773 remainingBlocksToConvert := 0
774 for _, b := range idx.NonParquetBlocks() {
775 if cortex_parquet.ShouldConvertBlockToParquet(b.MinTime, b.MaxTime, c.cfg.BlockRanges) {
776 remainingBlocksToConvert++
777 }
778 }
779 c.tenantParquetUnConvertedBlocks.WithLabelValues(userID).Set(float64(remainingBlocksToConvert))
780 }
781}
782
783func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger, userID string) {
784 existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger)

Callers 2

cleanUserMethod · 0.95

Calls 3

ParquetBlocksMethod · 0.80
NonParquetBlocksMethod · 0.80
SetMethod · 0.65

Tested by 1