use of org.apache.phoenix.pherf.jmx.Stat in project phoenix by apache.
the class GarbageCollectorElapsedTimeMonitor method getStat.
@Override
public Stat getStat() {
List<GarbageCollectorMXBean> beans = ManagementFactory.getGarbageCollectorMXBeans();
long average = 0;
Stat<Long> stat = null;
if (beans.size() > 0) {
for (GarbageCollectorMXBean bean : beans) {
average += bean.getCollectionTime();
}
stat = new Stat(average / beans.size());
} else {
stat = new Stat(0);
}
return stat;
}
Aggregations