]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/stats.py
stats: add /statistics web page to show them, add tests
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / stats.py
index 96fea7a6846351ada3cb1fda3d9b705099bd827a..1a0ae0d82552dde3a898d4248e5739824c0492e6 100644 (file)
@@ -103,15 +103,17 @@ class StatsProvider(foolscap.Referenceable, service.MultiService):
     def register_producer(self, stats_producer):
         self.stats_producers.append(IStatsProducer(stats_producer))
 
-    def remote_get_stats(self):
+    def get_stats(self):
         stats = {}
         for sp in self.stats_producers:
             stats.update(sp.get_stats())
-        #return { 'counters': self.counters, 'stats': stats }
         ret = { 'counters': self.counters, 'stats': stats }
-        log.msg(format='get_stats() -> %s', args=(pprint.pformat(ret),), level=12)
+        log.msg(format='get_stats() -> %(stats)s', stats=ret, level=log.NOISY)
         return ret
 
+    def remote_get_stats(self):
+        return self.get_stats()
+
     def _connected(self, gatherer, nickname):
         gatherer.callRemoteOnly('provide', self, nickname or '')