]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
stats: fix service issues
authorrobk-tahoe <robk-tahoe@allmydata.com>
Sat, 2 Feb 2008 01:57:31 +0000 (18:57 -0700)
committerrobk-tahoe <robk-tahoe@allmydata.com>
Sat, 2 Feb 2008 01:57:31 +0000 (18:57 -0700)
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.

src/allmydata/stats.py

index 7e3c64f6fc5a35cb1c4ed3f1f3dc39fd04eba8e2..1d060d6e034cce94b52b9e19e9c3e4dba5792eac 100644 (file)
@@ -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)