mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 19:08:12 +08:00
adds bottom bar with broker info
This commit is contained in:
@@ -80,6 +80,17 @@ def monitor(run_once=False, broker=None):
|
|||||||
print(term.move(i, 6 * col_width) + term.center(stat.reincarnations, width=col_width - 1))
|
print(term.move(i, 6 * col_width) + term.center(stat.reincarnations, width=col_width - 1))
|
||||||
print(term.move(i, 7 * col_width) + term.center(uptime, width=col_width - 1))
|
print(term.move(i, 7 * col_width) + term.center(uptime, width=col_width - 1))
|
||||||
i += 1
|
i += 1
|
||||||
|
# bottom bar
|
||||||
|
i += 1
|
||||||
|
print(term.move(i, 0) + term.white_on_cyan(term.center(broker.info(), width=col_width * 2)))
|
||||||
|
print(term.move(i, 2 * col_width) + term.black_on_cyan(term.center(_('Queued'), width=col_width)))
|
||||||
|
print(term.move(i, 3 * col_width) + term.white_on_cyan(term.center(broker.queue_size(), width=col_width)))
|
||||||
|
print(term.move(i, 4 * col_width) + term.black_on_cyan(term.center(_('Success'), width=col_width)))
|
||||||
|
print(term.move(i, 5 * col_width) + term.white_on_cyan(
|
||||||
|
term.center(models.Success.objects.count(), width=col_width)))
|
||||||
|
print(term.move(i, 6 * col_width) + term.black_on_cyan(term.center(_('Failures'), width=col_width)))
|
||||||
|
print(term.move(i, 7 * col_width) + term.white_on_cyan(
|
||||||
|
term.center(models.Failure.objects.count(), width=col_width)))
|
||||||
# for testing
|
# for testing
|
||||||
if run_once:
|
if run_once:
|
||||||
return Stat.get_all(broker=broker)
|
return Stat.get_all(broker=broker)
|
||||||
@@ -169,3 +180,4 @@ def info(broker=None):
|
|||||||
term.white('{0:.4f}'.format(exec_time))
|
term.white('{0:.4f}'.format(exec_time))
|
||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user