Added job details to "rq info" command (#1869)

* Update index.md

fixed minor duplicate article ("the its config var")

* added job details to rq info cli
This commit is contained in:
Tianci Hu Marrero 2023-04-01 08:49:45 -04:00 committed by GitHub
parent a9fae76e88
commit eadabc036b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 4 deletions

View File

@ -124,9 +124,13 @@ def show_queues(queues, raw, by_queue, queue_class, worker_class):
count = counts[q] count = counts[q]
if not raw: if not raw:
chart = green('|' + '' * int(ratio * count)) chart = green('|' + '' * int(ratio * count))
line = '%-12s %s %d' % (q.name, chart, count) line = '%-12s %s %d, %d executing, %d finished, %d failed' \
% (q.name, chart, count, q.started_job_registry.count, \
q.finished_job_registry.count, q.failed_job_registry.count)
else: else:
line = 'queue %s %d' % (q.name, count) line = 'queue %s %d, %d executing, %d finished, %d failed' \
% (q.name, count, q.started_job_registry.count, \
q.finished_job_registry.count, q.failed_job_registry.count)
click.echo(line) click.echo(line)
num_jobs += count num_jobs += count
@ -151,9 +155,15 @@ def show_workers(queues, raw, by_queue, queue_class, worker_class):
queue_names = ', '.join(worker.queue_names()) queue_names = ', '.join(worker.queue_names())
name = '%s (%s %s %s)' % (worker.name, worker.hostname, worker.ip_address, worker.pid) name = '%s (%s %s %s)' % (worker.name, worker.hostname, worker.ip_address, worker.pid)
if not raw: if not raw:
click.echo('%s: %s %s' % (name, state_symbol(worker.get_state()), queue_names)) line = '%s: %s %s. jobs: %d finished, %d failed' \
% (name, state_symbol(worker.get_state()), queue_names, \
worker.successful_job_count, worker.failed_job_count)
click.echo(line)
else: else:
click.echo('worker %s %s %s' % (name, worker.get_state(), queue_names)) line = 'worker %s %s %s. jobs: %d finished, %d failed' \
% (name, worker.get_state(), queue_names,\
worker.successful_job_count, worker.failed_job_count)
click.echo(line)
else: else:
# Display workers by queue # Display workers by queue