List of usage examples for javax.management.j2ee.statistics Statistic getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
From source file:org.hyperic.hq.plugin.websphere.WebsphereCollector.java
private double getStatCount(Statistic stat) { if (stat instanceof CountStatistic) { return ((CountStatistic) stat).getCount(); } else if (stat instanceof RangeStatistic) { return ((RangeStatistic) stat).getCurrent(); } else if (stat instanceof TimeStatistic) { // get the average time (same as MxUtil) double value; long count = ((TimeStatistic) stat).getCount(); if (count == 0) { value = 0;/* w w w.j av a 2 s . c o m*/ } else { value = ((TimeStatistic) stat).getTotalTime() / count; } return value; } else { log.error("Unsupported stat type: " + stat.getName() + "/" + stat.getClass().getName()); return MetricValue.VALUE_NONE; } }