IGNITE-9567 Added new metrics for data region and persistence.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/387674e2 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/387674e2 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/387674e2 Branch: refs/heads/ignite-7251 Commit: 387674e2fc74cbacfc6ff912ad71f75b9985c961 Parents: 390c6a8 Author: Alexey Kuznetsov <akuznet...@apache.org> Authored: Mon Sep 17 21:41:53 2018 +0700 Committer: Alexey Kuznetsov <akuznet...@apache.org> Committed: Mon Sep 17 21:41:53 2018 +0700 ---------------------------------------------------------------------- .../visor/cache/VisorMemoryMetrics.java | 68 ++++++++++++++++---- 1 file changed, 56 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/387674e2/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java index bfb0820..fd94421 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/cache/VisorMemoryMetrics.java @@ -69,9 +69,6 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { private int pageSize; /** */ - private long cpBufPages; - - /** */ private long cpBufSz; /** */ @@ -80,7 +77,6 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { /** */ private long cpUsedBufSz; - /** */ private long pagesRead; @@ -121,8 +117,7 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { pageSize = m.getPageSize(); - cpBufPages = m.getUsedCheckpointBufferPages(); - cpBufSz = m.getUsedCheckpointBufferSize(); + cpBufSz = m.getCheckpointBufferSize(); cpUsedBufPages = m.getUsedCheckpointBufferPages(); cpUsedBufSz = m.getUsedCheckpointBufferSize(); @@ -213,10 +208,12 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { } /** - * @return Checkpoint buffer size in pages. + * This method needed for compatibility with V2. + * + * @return Used checkpoint buffer size in pages. */ public long getCheckpointBufferPages() { - return cpBufPages; + return cpUsedBufPages; } /** @@ -227,12 +224,61 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { } /** + * @return Used checkpoint buffer size in pages. + */ + public long getUsedCheckpointBufferPages() { + return cpUsedBufPages; + } + + /** + * @return Used checkpoint buffer size in bytes. + */ + public long getUsedCheckpointBufferSize() { + return cpUsedBufSz; + } + + /** * @return Page size in bytes. */ public int getPageSize() { return pageSize; } + /** + * @return The number of read pages from last restart. + */ + public long getPagesRead() { + return pagesRead; + } + + /** + * @return The number of written pages from last restart. + */ + public long getPagesWritten() { + return pagesWritten; + } + + /** + * @return The number of replaced pages from last restart . + */ + public long getPagesReplaced() { + return pagesReplaced; + } + + /** + * @return Total offheap size in bytes. + */ + public long getOffHeapSize() { + return offHeapSz; + } + + /** + * @return Total used offheap size in bytes. + */ + public long getOffheapUsedSize() { + return offHeapUsedSz; + } + /** {@inheritDoc} */ @Override public byte getProtocolVersion() { return V3; @@ -253,12 +299,11 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { // V2 out.writeLong(totalAllocatedSz); out.writeLong(physicalMemSz); - out.writeLong(cpBufPages); + out.writeLong(cpUsedBufPages); out.writeLong(cpBufSz); out.writeInt(pageSize); // V3 - out.writeLong(cpUsedBufPages); out.writeLong(cpUsedBufSz); out.writeLong(pagesRead); @@ -284,13 +329,12 @@ public class VisorMemoryMetrics extends VisorDataTransferObject { if (protoVer > V1) { totalAllocatedSz = in.readLong(); physicalMemSz = in.readLong(); - cpBufPages = in.readLong(); + cpUsedBufPages = in.readLong(); cpBufSz = in.readLong(); pageSize = in.readInt(); } if (protoVer > V2) { - cpUsedBufPages = in.readLong(); cpUsedBufSz = in.readLong(); pagesRead = in.readLong();