xtern commented on code in PR #6563: URL: https://github.com/apache/ignite-3/pull/6563#discussion_r2333513160
########## modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java: ########## @@ -3134,16 +3151,47 @@ private static PartitionUpdateHandlers createPartitionUpdateHandlers( GcUpdateHandler gcUpdateHandler = new GcUpdateHandler(partitionDataStorage, safeTimeTracker, indexUpdateHandler); + LongSupplier partSizeSupplier = () -> partitionDataStorage.getStorage().estimatedSize(); + PartitionModificationCounter modificationCounter = partitionModificationCounterFactory.create(partSizeSupplier); + registerPartitionModificationCounterMetrics(table.tableId(), partitionId, modificationCounter); + StorageUpdateHandler storageUpdateHandler = new StorageUpdateHandler( partitionId, partitionDataStorage, indexUpdateHandler, - replicationConfiguration + replicationConfiguration, + modificationCounter ); return new PartitionUpdateHandlers(storageUpdateHandler, indexUpdateHandler, gcUpdateHandler); } + private void registerPartitionModificationCounterMetrics( + int tableId, int partitionId, PartitionModificationCounter counter) { + + PartitionModificationCounterMetricSource metricSource = + new PartitionModificationCounterMetricSource(tableId, partitionId); + + metricSource.addMetric(new LongGauge( + PartitionModificationCounterMetricSource.METRIC_COUNTER, + "The value of the volatile counter of partition modifications. " + + "This value is used to determine staleness of the related SQL statistics.", + counter::value + )); + + metricSource.addMetric(new LongGauge( Review Comment: Metric added -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org