Search in sources :

Example 1 with BoundedRangeStatistic

use of javax.management.j2ee.statistics.BoundedRangeStatistic in project Payara by payara.

the class StatsImpl method statToString.

public String statToString() {
    StringBuilder sbuf = new StringBuilder();
    Statistic[] stats = getStatistics();
    int sz = stats.length;
    for (int i = 0; i < sz; i++) {
        if (stats[i] instanceof CountStatistic) {
            CountStatistic stat = (CountStatistic) stats[i];
            sbuf.append(stat.getName()).append("=").append(stat.getCount()).append("; ");
        } else if (stats[i] instanceof BoundedRangeStatistic) {
            BoundedRangeStatistic stat = (BoundedRangeStatistic) stats[i];
            sbuf.append(stat.getName()).append("=").append(stat.getCurrent()).append("; ");
        } else {
            sbuf.append(stats[i].getName()).append("=?");
        }
    }
    return sbuf.toString();
}
Also used : CountStatistic(javax.management.j2ee.statistics.CountStatistic) BoundedRangeStatistic(javax.management.j2ee.statistics.BoundedRangeStatistic) Statistic(javax.management.j2ee.statistics.Statistic) CountStatistic(javax.management.j2ee.statistics.CountStatistic) BoundedRangeStatistic(javax.management.j2ee.statistics.BoundedRangeStatistic)

Aggregations

BoundedRangeStatistic (javax.management.j2ee.statistics.BoundedRangeStatistic)1 CountStatistic (javax.management.j2ee.statistics.CountStatistic)1 Statistic (javax.management.j2ee.statistics.Statistic)1