| 763 | } |
| 764 | |
| 765 | func (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 | |
| 783 | func (c *BlocksCleaner) cleanPartitionedGroupInfo(ctx context.Context, userBucket objstore.InstrumentedBucket, userLogger log.Logger, userID string) { |
| 784 | existentPartitionedGroupInfo, err := c.iterPartitionGroups(ctx, userBucket, userLogger) |