[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric. URL: https://github.com/apache/ignite/pull/6738#discussion_r324630618 ## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java ## @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) { this::getTotalAllocatedSize, "Total size of memory allocated for group, in bytes."); -mreg.register("StorageSize", -this::getStorageSize, -"Storage space allocated for group, in bytes."); +if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) { +mreg.register("StorageSize", +() -> database().forGroupPageStores(ctx, PageStore::size), +"Storage space allocated for group, in bytes."); -mreg.register("SparseStorageSize", -this::getSparseStorageSize, -"Storage space allocated for group adjusted for possible sparsity, in bytes."); +mreg.register("SparseStorageSize", +() -> database().forGroupPageStores(ctx, PageStore::getSparseSize), +"Storage space allocated for group adjusted for possible sparsity, in bytes."); + +storageSize = mreg.findMetric("StorageSize"); +sparseStorageSize = mreg.findMetric("SparseStorageSize"); +} +else { +storageSize = new AtomicLongMetric("NO_OP", null); Review comment: @nizhikov Done 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric. URL: https://github.com/apache/ignite/pull/6738#discussion_r324626745 ## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java ## @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) { this::getTotalAllocatedSize, "Total size of memory allocated for group, in bytes."); -mreg.register("StorageSize", -this::getStorageSize, -"Storage space allocated for group, in bytes."); +if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) { Review comment: Done 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric. URL: https://github.com/apache/ignite/pull/6738#discussion_r324626315 ## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java ## @@ -126,13 +133,22 @@ public CacheGroupMetricsImpl(CacheGroupContext ctx) { this::getTotalAllocatedSize, "Total size of memory allocated for group, in bytes."); -mreg.register("StorageSize", -this::getStorageSize, -"Storage space allocated for group, in bytes."); +if (ctx.shared().database() instanceof GridCacheDatabaseSharedManager) { +mreg.register("StorageSize", +() -> database().forGroupPageStores(ctx, PageStore::size), +"Storage space allocated for group, in bytes."); -mreg.register("SparseStorageSize", -this::getSparseStorageSize, -"Storage space allocated for group adjusted for possible sparsity, in bytes."); +mreg.register("SparseStorageSize", +() -> database().forGroupPageStores(ctx, PageStore::getSparseSize), +"Storage space allocated for group adjusted for possible sparsity, in bytes."); + +storageSize = mreg.findMetric("StorageSize"); +sparseStorageSize = mreg.findMetric("SparseStorageSize"); +} +else { +storageSize = new AtomicLongMetric("NO_OP", null); Review comment: @nizhikov This metric need to provide zero value when PDS disabled (we do not register those metrics in monitoring but it should be available from java API). For example, it can be read from deprecated CacheGroupMetricsMXBeanImpl. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [ignite] NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric.
NSAmelchev commented on a change in pull request #6738: IGNITE-12027 NPE on try to read the MinimumNumberOfPartitionCopies metric. URL: https://github.com/apache/ignite/pull/6738#discussion_r323675359 ## File path: modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheGroupMetricsImpl.java ## @@ -444,11 +472,25 @@ public void remove() { * @return Database. */ private GridCacheDatabaseSharedManager database() { +if (!(ctx.shared().database() instanceof GridCacheDatabaseSharedManager)) +return null; + return (GridCacheDatabaseSharedManager)ctx.shared().database(); } /** @return Metric group name. */ private String metricGroupName() { return metricName(CACHE_GROUP_METRICS_PREFIX, ctx.cacheOrGroupName()); } + +/** @return {@code True} if topology started. */ +private boolean isTopologyStarted() { Review comment: Done. TC bot is OK. @nizhikov Take a look, please. 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services