From: robk-tahoe Date: Sat, 2 Feb 2008 01:57:31 +0000 (-0700) Subject: stats: fix service issues X-Git-Tag: allmydata-tahoe-0.8.0~159 X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/flags/...?a=commitdiff_plain;h=f5a803303f0148d98fc09a1e167e10931bdc0f5f;p=tahoe-lafs%2Ftahoe-lafs.git stats: fix service issues having moved inititalisation into startService to handle tub init cleanly, I neglected the up-call to startService, which wound up not starting the load_monitor. also I changed the 'running' attribute to 'started' since 'running' is the name used internally by MultiService itself. --- diff --git a/src/allmydata/stats.py b/src/allmydata/stats.py index 7e3c64f6..1d060d6e 100644 --- a/src/allmydata/stats.py +++ b/src/allmydata/stats.py @@ -26,21 +26,21 @@ class LoadMonitor(service.MultiService): service.MultiService.__init__(self) self.provider = provider self.warn_if_delay_exceeds = warn_if_delay_exceeds - self.running = False + self.started = False self.last = None self.stats = deque() def startService(self): - if not self.running: - self.running = True + if not self.started: + self.started = True reactor.callLater(self.loop_interval, self.loop) service.MultiService.startService(self) def stopService(self): - self.running = False + self.started = False def loop(self): - if not self.running: + if not self.started: return now = time.time() if self.last is not None: @@ -86,6 +86,7 @@ class StatsProvider(foolscap.Referenceable, service.MultiService): nickname = self.node.get_config('nickname') self.node.tub.connectTo(self.gatherer_furl, self._connected, nickname) d.addCallback(connect) + service.MultiService.startService(self) def count(self, name, delta): val = self.counters.setdefault(name, 0)