run a stats provider even if there's no gatherer, since the HTTP /statistics page is then useful. Only run the once-per-second load-monitor if there is a gatherer configured

This commit is contained in:
Brian Warner
2008-05-08 11:37:30 -07:00
parent 3cb361e233
commit 462ef2a0ac
2 changed files with 15 additions and 12 deletions

View File

@ -114,12 +114,9 @@ class Client(node.Node, testutil.PollMixin):
def init_stats_provider(self):
gatherer_furl = self.get_config('stats_gatherer.furl')
if gatherer_furl:
self.stats_provider = StatsProvider(self, gatherer_furl)
self.add_service(self.stats_provider)
self.stats_provider.register_producer(self)
else:
self.stats_provider = None
self.stats_provider = StatsProvider(self, gatherer_furl)
self.add_service(self.stats_provider)
self.stats_provider.register_producer(self)
def get_stats(self):
return { 'node.uptime': time.time() - self.started_timestamp }