* Stats: Remove tunnel.Bps.* stats when the tunnel pool is closed

This commit is contained in:
zzz
2008-08-29 13:13:45 +00:00
parent e064b0a0e1
commit ee4d68cf6a
2 changed files with 8 additions and 0 deletions

View File

@ -112,6 +112,13 @@ public class StatManager {
} }
} }
// Hope this doesn't cause any problems with unsynchronized accesses like addRateData() ...
public void removeRateStat(String name) {
synchronized (_rateStats) {
_rateStats.remove(name);
}
}
/** update the given frequency statistic, taking note that an event occurred (and recalculating all frequencies) */ /** update the given frequency statistic, taking note that an event occurred (and recalculating all frequencies) */
public void updateFrequency(String name) { public void updateFrequency(String name) {
FrequencyStat freq = (FrequencyStat) _frequencyStats.get(name); FrequencyStat freq = (FrequencyStat) _frequencyStats.get(name);

View File

@ -89,6 +89,7 @@ public class TunnelPool {
_alive = false; _alive = false;
_lastSelectionPeriod = 0; _lastSelectionPeriod = 0;
_lastSelected = null; _lastSelected = null;
_context.statManager().removeRateStat(_rateName);
} }
TunnelPoolManager getManager() { return _manager; } TunnelPoolManager getManager() { return _manager; }