Created
August 19, 2018 06:07
-
-
Save snarkmaster/709e02df64cfc7402c5d963eb8ad45fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
response = query_bistro(args, { | |
'h': {'handler': 'histogram'}, | |
'j': {'handler': 'jobs'}, | |
}) | |
jobs = response['j']['data'] | |
histograms = response['h']['data']['histograms'] | |
for job_id, job in jobs.iteritems(): | |
print('Number of done or failed tasks for', job_id, '-', sum( | |
count for enc_bits, count in histograms[job_id][ | |
job['level_for_tasks'] | |
].iteritems() | |
for b in [TaskBits.decode(enc_bits)] | |
if b in [ | |
BistroTaskStatusBits.DONE, | |
BistroTaskStatusBits.FAILED, | |
] | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment