Search in sources :

Example 1 with Stat

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;
}
Also used : Stat(org.apache.phoenix.pherf.jmx.Stat) GarbageCollectorMXBean(java.lang.management.GarbageCollectorMXBean)

Aggregations

GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)1 Stat (org.apache.phoenix.pherf.jmx.Stat)1