use of org.apache.skywalking.apm.network.proto.PoolType in project incubator-skywalking by apache.
the class MemoryPoolModule method getMemoryPoolMetricList.
@Override
public List<MemoryPool> getMemoryPoolMetricList() {
List<MemoryPool> poolList = new LinkedList<MemoryPool>();
for (MemoryPoolMXBean bean : beans) {
String name = bean.getName();
PoolType type;
if (contains(getCodeCacheNames(), name)) {
type = PoolType.CODE_CACHE_USAGE;
} else if (contains(getEdenNames(), name)) {
type = PoolType.NEWGEN_USAGE;
} else if (contains(getOldNames(), name)) {
type = PoolType.OLDGEN_USAGE;
} else if (contains(getSurvivorNames(), name)) {
type = PoolType.SURVIVOR_USAGE;
} else if (contains(getMetaspaceNames(), name)) {
type = PoolType.METASPACE_USAGE;
} else if (contains(getPermNames(), name)) {
type = PoolType.PERMGEN_USAGE;
} else {
continue;
}
MemoryUsage usage = bean.getUsage();
poolList.add(MemoryPool.newBuilder().setType(type).setInit(usage.getInit()).setMax(usage.getMax()).setCommited(usage.getCommitted()).setUsed(usage.getUsed()).build());
}
return poolList;
}
Aggregations