diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java index c6075e8095b8..5d77147f0fdb 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java @@ -254,6 +254,14 @@ public int getTotalBufferCount() { return maxBufCount; } + public static long getHeapAllocationBytes(ByteBuffAllocator... allocators) { + long heapAllocBytes = 0; + for (ByteBuffAllocator alloc : Sets.newHashSet(allocators)) { + heapAllocBytes += alloc.getHeapAllocationBytes(); + } + return heapAllocBytes; + } + public static double getHeapAllocationRatio(ByteBuffAllocator... allocators) { double heapDelta = 0.0, poolDelta = 0.0; long heapAllocBytes, poolAllocBytes; diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon index 17fbe1ede622..96c7c2a1004e 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/ServerMetricsTmpl.jamon @@ -246,7 +246,7 @@ ByteBuffAllocator bbAllocator;