Search in sources :

Example 1 with ValueMonitor

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

the class AggregateRegionStatsMonitor method removeListener.

private MemberLevelRegionStatisticsListener removeListener(Statistics stats) {
    ValueMonitor monitor = monitors.remove(stats);
    if (monitor != null) {
        monitor.removeStatistics(stats);
    }
    MemberLevelRegionStatisticsListener listener = listeners.remove(stats);
    if (listener != null) {
        monitor.removeListener(listener);
    }
    return listener;
}
Also used : ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Example 2 with ValueMonitor

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

the class AggregateRegionStatsMonitor method addStatisticsToMonitor.

@Override
public void addStatisticsToMonitor(Statistics stats) {
    ValueMonitor regionMonitor = new ValueMonitor();
    MemberLevelRegionStatisticsListener listener = new MemberLevelRegionStatisticsListener();
    regionMonitor.addListener(listener);
    regionMonitor.addStatistics(stats);
    monitors.put(stats, regionMonitor);
    listeners.put(stats, listener);
}
Also used : ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Example 3 with ValueMonitor

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

the class MemberLevelDiskMonitor method addStatisticsToMonitor.

@Override
public void addStatisticsToMonitor(Statistics stats) {
    ValueMonitor diskMonitor = new ValueMonitor();
    MemberLevelDiskStatisticsListener listener = new MemberLevelDiskStatisticsListener();
    diskMonitor.addListener(listener);
    diskMonitor.addStatistics(stats);
    monitors.put(stats, diskMonitor);
    listeners.put(stats, listener);
}
Also used : ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Example 4 with ValueMonitor

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

the class MemberLevelDiskMonitor method removeStatisticsFromMonitor.

@Override
public void removeStatisticsFromMonitor(Statistics stats) {
    ValueMonitor monitor = monitors.remove(stats);
    if (monitor != null) {
        monitor.removeStatistics(stats);
    }
    MemberLevelDiskStatisticsListener listener = listeners.remove(stats);
    if (listener != null) {
        monitor.removeListener(listener);
    }
    listener.decreaseDiskStoreStats(stats);
}
Also used : ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Example 5 with ValueMonitor

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

the class MemberLevelDiskMonitor method stopListener.

@Override
public void stopListener() {
    for (Statistics stat : listeners.keySet()) {
        ValueMonitor monitor = monitors.get(stat);
        monitor.removeListener(listeners.get(stat));
        monitor.removeStatistics(stat);
    }
    listeners.clear();
    monitors.clear();
}
Also used : Statistics(org.apache.geode.Statistics) ValueMonitor(org.apache.geode.internal.statistics.ValueMonitor)

Aggregations

ValueMonitor (org.apache.geode.internal.statistics.ValueMonitor)6 Statistics (org.apache.geode.Statistics)2