Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ public long getTrailerHitCount() {

@Override
public long getByteBuffAllocatorHeapAllocationBytes() {
return this.allocator.getHeapAllocationBytes();
return ByteBuffAllocator.getHeapAllocationBytes(allocator, ByteBuffAllocator.HEAP);
}

@Override
Expand Down