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;
}
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);
}
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);
}
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);
}
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();
}
Aggregations