HBASE-23184 The HeapAllocation in WebUI is not accurate (#730)
Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
2451c2c532
commit
255be63e1d
|
@ -254,6 +254,14 @@ public class ByteBuffAllocator {
|
|||
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;
|
||||
|
|
|
@ -246,7 +246,7 @@ ByteBuffAllocator bbAllocator;
|
|||
<th>Buffer Size(Bytes)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><% bbAllocator.getHeapAllocationBytes() %></td>
|
||||
<td><% ByteBuffAllocator.getHeapAllocationBytes(bbAllocator, ByteBuffAllocator.HEAP) %></td>
|
||||
<td><% bbAllocator.getPoolAllocationBytes() %></td>
|
||||
<td><% String.format("%.3f", ByteBuffAllocator.getHeapAllocationRatio(bbAllocator, ByteBuffAllocator.HEAP) * 100) %><% "%" %></td>
|
||||
<td><% bbAllocator.getTotalBufferCount() %></td>
|
||||
|
|
|
@ -1010,7 +1010,7 @@ class MetricsRegionServerWrapperImpl
|
|||
|
||||
@Override
|
||||
public long getByteBuffAllocatorHeapAllocationBytes() {
|
||||
return this.allocator.getHeapAllocationBytes();
|
||||
return ByteBuffAllocator.getHeapAllocationBytes(allocator, ByteBuffAllocator.HEAP);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue