Skip to content

Commit

Permalink
Remove deprecation warnings related to access of PoolArenaMetric (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
mgodave authored and merlimat committed Feb 1, 2018
1 parent 69d2b66 commit fb72f72
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@ public static AllocatorStats generate(String allocatorName) {
}

AllocatorStats stats = new AllocatorStats();
stats.directArenas = allocator.directArenas().stream().map(x -> newPoolArenaStats(x))
.collect(Collectors.toList());
stats.heapArenas = allocator.heapArenas().stream().map(x -> newPoolArenaStats(x)).collect(Collectors.toList());
stats.directArenas = allocator.metric().directArenas().stream()
.map(AllocatorStatsGenerator::newPoolArenaStats)
.collect(Collectors.toList());
stats.heapArenas = allocator.metric().heapArenas().stream()
.map(AllocatorStatsGenerator::newPoolArenaStats)
.collect(Collectors.toList());

stats.numDirectArenas = allocator.numDirectArenas();
stats.numHeapArenas = allocator.numHeapArenas();
stats.numThreadLocalCaches = allocator.numThreadLocalCaches();
stats.normalCacheSize = allocator.normalCacheSize();
stats.smallCacheSize = allocator.smallCacheSize();
stats.tinyCacheSize = allocator.tinyCacheSize();
stats.numDirectArenas = allocator.metric().numDirectArenas();
stats.numHeapArenas = allocator.metric().numHeapArenas();
stats.numThreadLocalCaches = allocator.metric().numThreadLocalCaches();
stats.normalCacheSize = allocator.metric().normalCacheSize();
stats.smallCacheSize = allocator.metric().smallCacheSize();
stats.tinyCacheSize = allocator.metric().tinyCacheSize();
return stats;
}

Expand All @@ -66,9 +69,15 @@ private static PoolArenaStats newPoolArenaStats(PoolArenaMetric m) {
stats.numSmallSubpages = m.numSmallSubpages();
stats.numChunkLists = m.numChunkLists();

stats.tinySubpages = m.tinySubpages().stream().map(x -> newPoolSubpageStats(x)).collect(Collectors.toList());
stats.smallSubpages = m.smallSubpages().stream().map(x -> newPoolSubpageStats(x)).collect(Collectors.toList());
stats.chunkLists = m.chunkLists().stream().map(x -> newPoolChunkListStats(x)).collect(Collectors.toList());
stats.tinySubpages = m.tinySubpages().stream()
.map(AllocatorStatsGenerator::newPoolSubpageStats)
.collect(Collectors.toList());
stats.smallSubpages = m.smallSubpages().stream()
.map(AllocatorStatsGenerator::newPoolSubpageStats)
.collect(Collectors.toList());
stats.chunkLists = m.chunkLists().stream()
.map(AllocatorStatsGenerator::newPoolChunkListStats)
.collect(Collectors.toList());

stats.numAllocations = m.numAllocations();
stats.numTinyAllocations = m.numTinyAllocations();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public synchronized List<Metrics> generate() {
long totalAllocated = 0;
long totalUsed = 0;

for (PoolArenaMetric arena : allocator.directArenas()) {
for (PoolArenaMetric arena : allocator.metric().directArenas()) {
activeAllocations += arena.numActiveAllocations();
activeAllocationsTiny += arena.numActiveTinyAllocations();
activeAllocationsSmall += arena.numActiveSmallAllocations();
Expand Down

0 comments on commit fb72f72

Please sign in to comment.