Source:
public CacheGroupMetricsImpl(CacheGroupContext ctx) { this.ctx = ctx; CacheConfiguration cacheCfg = ctx.config(); DataStorageConfiguration dsCfg = ctx.shared().kernalContext().config().getDataStorageConfiguration(); boolean persistentEnabled = CU.isPersistentCache(cacheCfg, dsCfg); MetricRegistry mreg = ctx.shared().kernalContext().metric().registry(metricGroupName()); mreg.register("Caches", this::getCaches, List.class, null); storageSize = mreg.register("StorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::size) : 0, "Storage space allocated for group, in bytes."); sparseStorageSize = mreg.register("SparseStorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::getSparseSize) : 0, "Storage space allocated for group adjusted for possible sparsity, in bytes."); idxBuildCntPartitionsLeft = mreg.longMetric("IndexBuildCountPartitionsLeft", "Number of partitions need processed for finished indexes create or rebuilding."); rebalancingPartitionsLeft = mreg.longMetric("rebalancingPartitionsLeft", "Number of rebalanced partitions left."); rebalancingReceivedKeys = mreg.longMetric("rebalancingReceivedKeys", "Number of already rebalanced keys."); rebalancingReceivedBytes = mreg.longMetric("rebalancingReceivedBytes", "Number of already rebalanced bytes."); rebalancingStartTime = mreg.longMetric("rebalancingStartTime", "Rebalancing start time."); rebalancingStartTime.value(-1L); rebalancingFinishTime = mreg.longMetric("rebalancingFinishTime", "Rebalancing finish time."); rebalancingFinishTime.value(-1L); DataRegion region = ctx.dataRegion(); if (region != null) { DataRegionMetricsImpl dataRegionMetrics = ctx.dataRegion().memoryMetrics(); grpPageAllocationTracker = dataRegionMetrics.getOrAllocateGroupPageAllocationTracker(ctx.cacheOrGroupName()); } else grpPageAllocationTracker = new LongAdderMetric("NO_OP", null); }

Target:
public CacheGroupMetricsImpl(CacheGroupContext ctx) { this.ctx = ctx; CacheConfiguration cacheCfg = ctx.config(); DataStorageConfiguration dsCfg = ctx.shared().kernalContext().config().getDataStorageConfiguration(); boolean persistentEnabled = CU.isPersistentCache(cacheCfg, dsCfg); MetricRegistry mreg = ctx.shared().kernalContext().metric().registry(metricGroupName()); mreg.register("Caches", this::getCaches, List.class, null); storageSize = mreg.register("StorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::size) : 0, "Storage space allocated for group, in bytes."); sparseStorageSize = mreg.register("SparseStorageSize", () -> persistentEnabled ? database().forGroupPageStores(ctx, PageStore::getSparseSize) : 0, "Storage space allocated for group adjusted for possible sparsity, in bytes."); idxBuildCntPartitionsLeft = mreg.longMetric("IndexBuildCountPartitionsLeft", "Number of partitions need processed for finished indexes create or rebuilding."); DataRegion region = ctx.dataRegion(); if (region != null) { DataRegionMetricsImpl dataRegionMetrics = ctx.dataRegion().memoryMetrics(); grpPageAllocationTracker = dataRegionMetrics.getOrAllocateGroupPageAllocationTracker(ctx.cacheOrGroupName()); } else grpPageAllocationTracker = new LongAdderMetric("NO_OP", null); }