mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 03:28:11 +08:00
Limited hostname width in monitor
This commit is contained in:
@@ -53,16 +53,14 @@ def monitor(run_once=False):
|
|||||||
hours, remainder = divmod(uptime, 3600)
|
hours, remainder = divmod(uptime, 3600)
|
||||||
minutes, seconds = divmod(remainder, 60)
|
minutes, seconds = divmod(remainder, 60)
|
||||||
uptime = '%d:%02d:%02d' % (hours, minutes, seconds)
|
uptime = '%d:%02d:%02d' % (hours, minutes, seconds)
|
||||||
print(term.move(i, 0) + term.center('{}'.format(stat.host), width=col_width - 1))
|
print(term.move(i, 0) + term.center(stat.host[:col_width - 1], width=col_width - 1))
|
||||||
print(term.move(i, 1 * col_width) + term.center('{}'.format(stat.cluster_id), width=col_width - 1))
|
print(term.move(i, 1 * col_width) + term.center(stat.cluster_id, width=col_width - 1))
|
||||||
print(term.move(i, 2 * col_width) + term.center('{}'.format(status), width=col_width - 1))
|
print(term.move(i, 2 * col_width) + term.center(status, width=col_width - 1))
|
||||||
print(
|
print(term.move(i, 3 * col_width) + term.center(len(stat.workers), width=col_width - 1))
|
||||||
term.move(i, 3 * col_width) + term.center('{}'.format(len(stat.workers)), width=col_width - 1))
|
print(term.move(i, 4 * col_width) + term.center(stat.task_q_size, width=col_width - 1))
|
||||||
print(term.move(i, 4 * col_width) + term.center('{}'.format(stat.task_q_size), width=col_width - 1))
|
print(term.move(i, 5 * col_width) + term.center(stat.done_q_size, width=col_width - 1))
|
||||||
print(term.move(i, 5 * col_width) + term.center('{}'.format(stat.done_q_size), width=col_width - 1))
|
print(term.move(i, 6 * col_width) + term.center(stat.reincarnations, width=col_width - 1))
|
||||||
print(term.move(i, 6 * col_width) + term.center('{}'.format(stat.reincarnations),
|
print(term.move(i, 7 * col_width) + term.center(uptime, width=col_width - 1))
|
||||||
width=col_width - 1))
|
|
||||||
print(term.move(i, 7 * col_width) + term.center('{}'.format(uptime), width=col_width - 1))
|
|
||||||
i += 1
|
i += 1
|
||||||
# for testing
|
# for testing
|
||||||
if run_once:
|
if run_once:
|
||||||
|
|||||||
Reference in New Issue
Block a user