ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [09/50] [abbrv] ignite git commit: IGNITE-2726 Added missing off heap metrics for Visor Console.
Date Mon, 21 Mar 2016 14:20:34 GMT
IGNITE-2726 Added missing off heap metrics for Visor Console.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/dc8630b6
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/dc8630b6
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/dc8630b6

Branch: refs/heads/ignite-2801
Commit: dc8630b6e6afc95fdfa7dda21d3fa747e95347b1
Parents: c951fc0
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Mon Feb 29 11:26:32 2016 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Mon Feb 29 11:26:32 2016 +0700

----------------------------------------------------------------------
 .../ignite/internal/visor/cache/VisorCache.java |   2 +-
 .../cache/VisorCacheAggregatedMetrics.java      | 113 ++++++++++++++-----
 .../internal/visor/cache/VisorCacheMetrics.java |  88 +++++++--------
 .../cache/VisorCacheMetricsCollectorTask.java   |  21 +++-
 .../visor/cache/VisorCacheMetricsV2.java        |  66 +++++++++++
 .../internal/visor/cache/VisorCacheV2.java      |   2 +-
 .../commands/cache/VisorCacheCommand.scala      |  30 +++--
 7 files changed, 238 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
index 9115c0c..7cd0669 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCache.java
@@ -215,7 +215,7 @@ public class VisorCache implements Serializable {
         offHeapAllocatedSize = ca.offHeapAllocatedSize();
         offHeapEntriesCnt = ca.offHeapEntriesCount();
         partitions = ca.affinity().partitions();
-        metrics = VisorCacheMetrics.from(ignite, cacheName);
+        metrics = new VisorCacheMetrics().from(ignite, cacheName);
 
         estimateMemorySize(ignite, ca, sample);
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
index fba8a0d..0cba24b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheAggregatedMetrics.java
@@ -44,14 +44,23 @@ public class VisorCacheAggregatedMetrics implements Serializable {
     /** Node IDs with cache metrics. */
     private final Map<UUID, VisorCacheMetrics> metrics = new HashMap<>();
 
-    /** Minimum number of elements in the cache. */
-    private transient Integer minSize;
+    /** Minimum number of elements in heap. */
+    private transient Long minHeapSize;
 
-    /** Average number of elements in the cache. */
-    private transient Double avgSize;
+    /** Average number of elements in heap. */
+    private transient Double avgHeapSize;
 
-    /** Maximum number of elements in the cache. */
-    private transient Integer maxSize;
+    /** Maximum number of elements in heap. */
+    private transient Long maxHeapSize;
+
+    /** Minimum number of elements in off heap. */
+    private transient Long minOffHeapSize;
+
+    /** Average number of elements in off heap. */
+    private transient Double avgOffHeapSize;
+
+    /** Maximum number of elements in off heap. */
+    private transient Long maxOffHeapSize;
 
     /** Minimum hits of the owning cache. */
     private transient Long minHits;
@@ -148,47 +157,99 @@ public class VisorCacheAggregatedMetrics implements Serializable {
     }
 
     /**
-     * @return Minimum number of elements in the cache.
+     * @return Minimum number of elements in heap.
+     */
+    public long minimumHeapSize() {
+        if (minHeapSize == null) {
+            minHeapSize = Long.MAX_VALUE;
+
+            for (VisorCacheMetrics metric : metrics.values())
+                minHeapSize = Math.min(minHeapSize, metric.keySize());
+        }
+
+        return minHeapSize;
+    }
+
+    /**
+     * @return Average number of elements in heap.
+     */
+    public double averageHeapSize() {
+        if (avgHeapSize == null) {
+            avgHeapSize = 0.0d;
+
+            for (VisorCacheMetrics metric : metrics.values())
+                avgHeapSize += metric.keySize();
+
+            avgHeapSize /= metrics.size();
+        }
+
+        return avgHeapSize;
+    }
+
+    /**
+     * @return Maximum number of elements in heap.
+     */
+    public long maximumHeapSize() {
+        if (maxHeapSize == null) {
+            maxHeapSize = Long.MIN_VALUE;
+
+            for (VisorCacheMetrics metric : metrics.values())
+                maxHeapSize = Math.max(maxHeapSize, metric.keySize());
+        }
+
+        return maxHeapSize;
+    }
+
+    /**
+     * @param metric Metrics to process.
+     * @return Off heap entries count.
+     */
+    private long offHeapEntriesCount(VisorCacheMetrics metric) {
+        return metric instanceof VisorCacheMetricsV2 ? ((VisorCacheMetricsV2) metric).offHeapEntriesCount()
: 0;
+    }
+
+    /**
+     * @return Minimum number of elements in off heap.
      */
-    public int minimumSize() {
-        if (minSize == null) {
-            minSize = Integer.MAX_VALUE;
+    public long minimumOffHeapSize() {
+        if (minOffHeapSize == null) {
+            minOffHeapSize = Long.MAX_VALUE;
 
             for (VisorCacheMetrics metric : metrics.values())
-                minSize = Math.min(minSize, metric.keySize());
+                minOffHeapSize = Math.min(minOffHeapSize, offHeapEntriesCount(metric));
         }
 
-        return minSize;
+        return minOffHeapSize;
     }
 
     /**
-     * @return Average number of elements in the cache.
+     * @return Average number of elements in off heap.
      */
-    public double averageSize() {
-        if (avgSize == null) {
-            avgSize = 0.0d;
+    public double averageOffHeapSize() {
+        if (avgOffHeapSize == null) {
+            avgOffHeapSize = 0.0d;
 
             for (VisorCacheMetrics metric : metrics.values())
-                avgSize += metric.keySize();
+                avgOffHeapSize += offHeapEntriesCount(metric);
 
-            avgSize /= metrics.size();
+            avgOffHeapSize /= metrics.size();
         }
 
-        return avgSize;
+        return avgOffHeapSize;
     }
 
     /**
-     * @return Maximum number of elements in the cache.
+     * @return Maximum number of elements in off heap in the cache.
      */
-    public int maximumSize() {
-        if (maxSize == null) {
-            maxSize = Integer.MIN_VALUE;
+    public long maximumOffHeapSize() {
+        if (maxOffHeapSize == null) {
+            maxOffHeapSize = Long.MIN_VALUE;
 
             for (VisorCacheMetrics metric : metrics.values())
-                maxSize = Math.max(maxSize, metric.keySize());
+                maxOffHeapSize = Math.max(maxOffHeapSize, offHeapEntriesCount(metric));
         }
 
-        return maxSize;
+        return maxOffHeapSize;
     }
 
     /**
@@ -460,4 +521,4 @@ public class VisorCacheAggregatedMetrics implements Serializable {
     @Override public String toString() {
         return S.toString(VisorCacheAggregatedMetrics.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
index 2844c12..1a88813 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetrics.java
@@ -170,66 +170,64 @@ public class VisorCacheMetrics implements Serializable {
      * @param cacheName Cache name.
      * @return Data transfer object for given cache metrics.
      */
-    public static VisorCacheMetrics from(IgniteEx ignite, String cacheName) {
-        VisorCacheMetrics cm = new VisorCacheMetrics();
-
+    public VisorCacheMetrics from(IgniteEx ignite, String cacheName) {
         GridCacheProcessor cacheProcessor = ignite.context().cache();
 
         IgniteCache<Object, Object> c = cacheProcessor.jcache(cacheName);
 
-        cm.name = cacheName;
-        cm.mode = cacheProcessor.cacheMode(cacheName);
-        cm.sys = cacheProcessor.systemCache(cacheName);
+        name = cacheName;
+        mode = cacheProcessor.cacheMode(cacheName);
+        sys = cacheProcessor.systemCache(cacheName);
 
         CacheMetrics m = c.metrics();
 
-        cm.size = m.getSize();
-        cm.keySize = m.getKeySize();
+        size = m.getSize();
+        keySize = m.getKeySize();
 
-        cm.reads = m.getCacheGets();
-        cm.writes = m.getCachePuts() + m.getCacheRemovals();
-        cm.hits = m.getCacheHits();
-        cm.misses = m.getCacheMisses();
+        reads = m.getCacheGets();
+        writes = m.getCachePuts() + m.getCacheRemovals();
+        hits = m.getCacheHits();
+        misses = m.getCacheMisses();
 
-        cm.txCommits = m.getCacheTxCommits();
-        cm.txRollbacks = m.getCacheTxRollbacks();
+        txCommits = m.getCacheTxCommits();
+        txRollbacks = m.getCacheTxRollbacks();
 
-        cm.avgTxCommitTime = m.getAverageTxCommitTime();
-        cm.avgTxRollbackTime = m.getAverageTxRollbackTime();
+        avgTxCommitTime = m.getAverageTxCommitTime();
+        avgTxRollbackTime = m.getAverageTxRollbackTime();
 
-        cm.puts = m.getCachePuts();
-        cm.removals = m.getCacheRemovals();
-        cm.evictions = m.getCacheEvictions();
+        puts = m.getCachePuts();
+        removals = m.getCacheRemovals();
+        evictions = m.getCacheEvictions();
 
-        cm.avgReadTime = m.getAverageGetTime();
-        cm.avgPutTime = m.getAveragePutTime();
-        cm.avgRemovalTime = m.getAverageRemoveTime();
+        avgReadTime = m.getAverageGetTime();
+        avgPutTime = m.getAveragePutTime();
+        avgRemovalTime = m.getAverageRemoveTime();
 
-        cm.readsPerSec = perSecond(m.getAverageGetTime());
-        cm.putsPerSec = perSecond(m.getAveragePutTime());
-        cm.removalsPerSec = perSecond(m.getAverageRemoveTime());
-        cm.commitsPerSec = perSecond(m.getAverageTxCommitTime());
-        cm.rollbacksPerSec = perSecond(m.getAverageTxRollbackTime());
+        readsPerSec = perSecond(m.getAverageGetTime());
+        putsPerSec = perSecond(m.getAveragePutTime());
+        removalsPerSec = perSecond(m.getAverageRemoveTime());
+        commitsPerSec = perSecond(m.getAverageTxCommitTime());
+        rollbacksPerSec = perSecond(m.getAverageTxRollbackTime());
 
-        cm.qryMetrics = VisorCacheQueryMetrics.from(c.queryMetrics());
+        qryMetrics = VisorCacheQueryMetrics.from(c.queryMetrics());
 
-        cm.dhtEvictQueueCurrSize = m.getDhtEvictQueueCurrentSize();
-        cm.txThreadMapSize = m.getTxThreadMapSize();
-        cm.txXidMapSize = m.getTxXidMapSize();
-        cm.txCommitQueueSize = m.getTxCommitQueueSize();
-        cm.txPrepareQueueSize = m.getTxPrepareQueueSize();
-        cm.txStartVerCountsSize = m.getTxStartVersionCountsSize();
-        cm.txCommittedVersionsSize = m.getTxCommittedVersionsSize();
-        cm.txRolledbackVersionsSize = m.getTxRolledbackVersionsSize();
-        cm.txDhtThreadMapSize = m.getTxDhtThreadMapSize();
-        cm.txDhtXidMapSize = m.getTxDhtXidMapSize();
-        cm.txDhtCommitQueueSize = m.getTxDhtCommitQueueSize();
-        cm.txDhtPrepareQueueSize = m.getTxDhtPrepareQueueSize();
-        cm.txDhtStartVerCountsSize = m.getTxDhtStartVersionCountsSize();
-        cm.txDhtCommittedVersionsSize = m.getTxDhtCommittedVersionsSize();
-        cm.txDhtRolledbackVersionsSize = m.getTxDhtRolledbackVersionsSize();
+        dhtEvictQueueCurrSize = m.getDhtEvictQueueCurrentSize();
+        txThreadMapSize = m.getTxThreadMapSize();
+        txXidMapSize = m.getTxXidMapSize();
+        txCommitQueueSize = m.getTxCommitQueueSize();
+        txPrepareQueueSize = m.getTxPrepareQueueSize();
+        txStartVerCountsSize = m.getTxStartVersionCountsSize();
+        txCommittedVersionsSize = m.getTxCommittedVersionsSize();
+        txRolledbackVersionsSize = m.getTxRolledbackVersionsSize();
+        txDhtThreadMapSize = m.getTxDhtThreadMapSize();
+        txDhtXidMapSize = m.getTxDhtXidMapSize();
+        txDhtCommitQueueSize = m.getTxDhtCommitQueueSize();
+        txDhtPrepareQueueSize = m.getTxDhtPrepareQueueSize();
+        txDhtStartVerCountsSize = m.getTxDhtStartVersionCountsSize();
+        txDhtCommittedVersionsSize = m.getTxDhtCommittedVersionsSize();
+        txDhtRolledbackVersionsSize = m.getTxDhtRolledbackVersionsSize();
 
-        return cm;
+        return this;
     }
 
     /**
@@ -516,4 +514,4 @@ public class VisorCacheMetrics implements Serializable {
     @Override public String toString() {
         return S.toString(VisorCacheMetrics.class, this);
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
index abed7db..4dd1e28 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsCollectorTask.java
@@ -21,6 +21,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
+import org.apache.ignite.cluster.ClusterNode;
 import org.apache.ignite.compute.ComputeJobResult;
 import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
 import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
@@ -30,6 +31,7 @@ import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.internal.visor.VisorJob;
 import org.apache.ignite.internal.visor.VisorMultiNodeTask;
 import org.apache.ignite.lang.IgniteBiTuple;
+import org.apache.ignite.lang.IgniteProductVersion;
 import org.jetbrains.annotations.Nullable;
 
 /**
@@ -77,9 +79,13 @@ public class VisorCacheMetricsCollectorTask extends VisorMultiNodeTask<IgniteBiT
      */
     private static class VisorCacheMetricsCollectorJob
         extends VisorJob<IgniteBiTuple<Boolean, Collection<String>>, Collection<VisorCacheMetrics>>
{
+
         /** */
         private static final long serialVersionUID = 0L;
 
+        /** */
+        private static final IgniteProductVersion V2_SINCE = IgniteProductVersion.fromString("1.5.8");
+
         /**
          * Create job with given argument.
          *
@@ -114,7 +120,18 @@ public class VisorCacheMetricsCollectorTask extends VisorMultiNodeTask<IgniteBiT
                 if (ca.context().started()) {
                     String cacheName = ca.getName();
 
-                    VisorCacheMetrics cm = VisorCacheMetrics.from(ignite, cacheName);
+                    boolean compatibilityMode = false;
+
+                    for (ClusterNode node : ignite.cluster().nodes()) {
+                        if (node.version().compareToIgnoreTimestamp(V2_SINCE) < 0) {
+                            compatibilityMode = true;
+
+                            break;
+                        }
+                    }
+
+                    VisorCacheMetrics cm = (compatibilityMode ? new VisorCacheMetrics() :
new VisorCacheMetricsV2())
+                            .from(ignite, cacheName);
 
                     if ((allCaches || cacheNames.contains(cacheName)) && (showSysCaches
|| !cm.system()))
                         res.add(cm);
@@ -129,4 +146,4 @@ public class VisorCacheMetricsCollectorTask extends VisorMultiNodeTask<IgniteBiT
             return S.toString(VisorCacheMetricsCollectorJob.class, this);
         }
     }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsV2.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsV2.java
new file mode 100644
index 0000000..2376db0
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheMetricsV2.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.visor.cache;
+
+import org.apache.ignite.cache.CacheMetrics;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.processors.cache.GridCacheAdapter;
+import org.apache.ignite.internal.processors.cache.GridCacheProcessor;
+
+/**
+ * Data transfer object for {@link CacheMetrics}.
+ */
+public class VisorCacheMetricsV2 extends VisorCacheMetrics {
+    /** */
+    private static final long serialVersionUID = 0L;
+
+    /** Memory size allocated in off-heap. */
+    private long offHeapAllocatedSize;
+
+    /** Number of cache entries stored in off-heap memory. */
+    private long offHeapEntriesCount;
+
+    /** {@inheritDoc} */
+    @Override
+    public VisorCacheMetrics from(IgniteEx ignite, String cacheName) {
+        super.from(ignite, cacheName);
+
+        GridCacheProcessor cacheProcessor = ignite.context().cache();
+
+        GridCacheAdapter<Object, Object> c = cacheProcessor.internalCache(cacheName);
+
+        offHeapAllocatedSize = c.offHeapAllocatedSize();
+        offHeapEntriesCount = c.offHeapEntriesCount();
+
+        return this;
+    }
+
+    /**
+     * @return Memory size allocated in off-heap.
+     */
+    public long offHeapAllocatedSize() {
+        return offHeapAllocatedSize;
+    }
+
+    /**
+     * @return Number of cache entries stored in off-heap memory.
+     */
+    public long offHeapEntriesCount() {
+        return offHeapEntriesCount;
+    }
+}

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
index 6b6aba2..61551cc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorCacheV2.java
@@ -41,7 +41,7 @@ public class VisorCacheV2 extends VisorCache {
         if (c != null && c instanceof VisorCacheV2) {
             GridCacheAdapter ca = ignite.context().cache().internalCache(cacheName);
 
-            // Cache was not started.
+            // Process only started caches.
             if (ca != null && ca.context().started())
                 ((VisorCacheV2)c).near = ca.context().isNear();
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/dc8630b6/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
----------------------------------------------------------------------
diff --git a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
index 13b4e32..b6812c3 100644
--- a/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
+++ b/modules/visor-console/src/main/scala/org/apache/ignite/visor/commands/cache/VisorCacheCommand.scala
@@ -316,7 +316,7 @@ class VisorCacheCommand {
 
             val sumT = VisorTextTable()
 
-            sumT #= ("Name(@)", "Mode", "Nodes", "Entries", "Hits", "Misses", "Reads", "Writes")
+            sumT #= ("Name(@)", "Mode", "Nodes", "Entries (Heap / Off heap)", "Hits", "Misses",
"Reads", "Writes")
 
             sortAggregatedData(aggrData, sortType.getOrElse("cn"), reversed).foreach(
                 ad => {
@@ -328,9 +328,12 @@ class VisorCacheCommand {
                         ad.mode(),
                         ad.nodes.size(),
                         (
-                            "min: " + ad.minimumSize,
-                            "avg: " + formatDouble(ad.averageSize),
-                            "max: " + ad.maximumSize
+                            "min: " + (ad.minimumHeapSize() + ad.minimumOffHeapSize()) +
+                                " (" + ad.minimumHeapSize() + " / " + ad.minimumOffHeapSize()
+ ")",
+                            "avg: " + formatDouble(ad.averageHeapSize() + ad.averageOffHeapSize())
+
+                                " (" + formatDouble(ad.averageHeapSize()) + " / " + formatDouble(ad.averageOffHeapSize())
+ ")",
+                            "max: " + (ad.maximumHeapSize() + ad.maximumOffHeapSize()) +
+                                " (" + ad.maximumHeapSize() + " / " + ad.maximumOffHeapSize()
+ ")"
                             ),
                         (
                             "min: " + ad.minimumHits,
@@ -382,7 +385,13 @@ class VisorCacheCommand {
 
                     csT += ("Name(@)", cacheNameVar)
                     csT += ("Nodes", m.size())
-                    csT += ("Size Min/Avg/Max", ad.minimumSize + " / " + formatDouble(ad.averageSize)
+ " / " + ad.maximumSize)
+                    csT += ("Total size Min/Avg/Max", (ad.minimumHeapSize() + ad.minimumOffHeapSize())
+ " / " +
+                        formatDouble(ad.averageHeapSize() + ad.averageOffHeapSize()) + "
/ " +
+                        (ad.maximumHeapSize() + ad.maximumOffHeapSize()))
+                    csT += ("  Heap size Min/Avg/Max", ad.minimumHeapSize() + " / " +
+                        formatDouble(ad.averageHeapSize()) + " / " + ad.maximumHeapSize())
+                    csT += ("  Off heap size Min/Avg/Max", ad.minimumOffHeapSize() + " /
" +
+                        formatDouble(ad.averageOffHeapSize()) + " / " + ad.maximumOffHeapSize())
 
                     val ciT = VisorTextTable()
 
@@ -617,7 +626,7 @@ class VisorCacheCommand {
 
         val sumT = VisorTextTable()
 
-        sumT #= ("#", "Name(@)", "Mode", "Size")
+        sumT #= ("#", "Name(@)", "Mode", "Size (Heap / Off heap)")
 
         sortedAggrData.indices.foreach(i => {
             val ad = sortedAggrData(i)
@@ -630,9 +639,12 @@ class VisorCacheCommand {
                 mkCacheName(ad.name()),
                 ad.mode(),
                 (
-                    "min: " + ad.minimumSize,
-                    "avg: " + formatDouble(ad.averageSize),
-                    "max: " + ad.maximumSize
+                    "min: " + (ad.minimumHeapSize() + ad.minimumOffHeapSize()) +
+                        " (" + ad.minimumHeapSize() + " / " + ad.minimumOffHeapSize() + ")",
+                    "avg: " + formatDouble(ad.averageHeapSize() + ad.averageOffHeapSize())
+
+                        " (" + formatDouble(ad.averageHeapSize()) + " / " + formatDouble(ad.averageOffHeapSize())
+ ")",
+                    "max: " + (ad.maximumHeapSize() + ad.maximumOffHeapSize()) +
+                        " (" + ad.maximumHeapSize() + " / " + ad.maximumOffHeapSize() + ")"
                 ))
         })
 


Mime
View raw message