Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
don't intify time. Simply limit precision (for tests and practicality…
Browse files Browse the repository at this point in the history
…) when displaying worker age.
  • Loading branch information
Jim Fulton committed Feb 11, 2015
1 parent 65e5c99 commit e0ab412
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/zc/resumelb/zk.py
Expand Up @@ -324,9 +324,9 @@ def get_lb_status(args=None):
status = json.loads(status_file.read())
status_file.close()
status_socket.close()
now = int(time.time())
workers = status['workers']
if workers:
now = time.time()
print ' backlog: %s, mean backlog: %.1f' % (
status['backlog'], status['mean_backlog'])
print ' workers: %s, mean backlog per worker: %.1f' % (
Expand All @@ -338,6 +338,6 @@ def get_lb_status(args=None):
for name, bl, mbl, start in sorted(workers):
print worker_format % (
name, bl, "%.1f" % mbl,
now-start if start is not None else '-')
("%.1f" % (now-start) if start is not None else '-'))
else:
print 'This load-balancer has no workers!'

0 comments on commit e0ab412

Please sign in to comment.