Search in sources :

Example 1 with StatisticNotFoundException

use of org.apache.geode.internal.statistics.StatisticNotFoundException in project geode by apache.

the class VMStatsMonitor method handleNotification.

@Override
public void handleNotification(StatisticsNotification notification) {
    for (StatisticId statId : notification) {
        StatisticDescriptor descriptor = statId.getStatisticDescriptor();
        String name = descriptor.getName();
        Number value;
        try {
            value = notification.getValue(statId);
        } catch (StatisticNotFoundException e) {
            value = 0;
        }
        log(name, value);
        statsMap.put(name, value);
    }
    refreshStats();
}
Also used : StatisticNotFoundException(org.apache.geode.internal.statistics.StatisticNotFoundException) StatisticId(org.apache.geode.internal.statistics.StatisticId) StatisticDescriptor(org.apache.geode.StatisticDescriptor)

Example 2 with StatisticNotFoundException

use of org.apache.geode.internal.statistics.StatisticNotFoundException in project geode by apache.

the class MBeanStatsMonitor method handleNotification.

@Override
public void handleNotification(final StatisticsNotification notification) {
    for (StatisticId statId : notification) {
        StatisticDescriptor descriptor = statId.getStatisticDescriptor();
        String name = descriptor.getName();
        Number value;
        try {
            value = notification.getValue(statId);
        } catch (StatisticNotFoundException e) {
            value = 0;
        }
        log(name, value);
        statsMap.put(name, value);
    }
}
Also used : StatisticNotFoundException(org.apache.geode.internal.statistics.StatisticNotFoundException) StatisticId(org.apache.geode.internal.statistics.StatisticId) StatisticDescriptor(org.apache.geode.StatisticDescriptor)

Example 3 with StatisticNotFoundException

use of org.apache.geode.internal.statistics.StatisticNotFoundException in project geode by apache.

the class GCStatsMonitor method handleNotification.

@Override
public void handleNotification(StatisticsNotification notification) {
    decreasePrevValues(statsMap);
    for (StatisticId statId : notification) {
        StatisticDescriptor descriptor = statId.getStatisticDescriptor();
        String name = descriptor.getName();
        Number value;
        try {
            value = notification.getValue(statId);
        } catch (StatisticNotFoundException e) {
            value = 0;
        }
        log(name, value);
        increaseStats(name, value);
        statsMap.put(name, value);
    }
}
Also used : StatisticNotFoundException(org.apache.geode.internal.statistics.StatisticNotFoundException) StatisticId(org.apache.geode.internal.statistics.StatisticId) StatisticDescriptor(org.apache.geode.StatisticDescriptor)

Aggregations

StatisticDescriptor (org.apache.geode.StatisticDescriptor)3 StatisticId (org.apache.geode.internal.statistics.StatisticId)3 StatisticNotFoundException (org.apache.geode.internal.statistics.StatisticNotFoundException)3