Skip to content

Commit

Permalink
batch job count
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Oct 8, 2024
1 parent 80fbed2 commit 83e808d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/ruby/lib/merritt_zk_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ def self.list_batches_as_json(zk)
batchjson = batch.data
batchjson[:id] = batch.id
batchjson[:status] = batch.status_name
batchjson[:jobCountFailed] = batch.get_failed_jobs(zk).length
batchjson[:jobCountDeleted] = batch.get_deleted_jobs(zk).length
batchjson[:jobCountCompleted] = batch.get_completed_jobs(zk).length
batchjson[:jobCountProcessing] = batch.get_processing_jobs(zk).length
batchjson[:jobCount] = batch.get_processing_jobs(zk).length +
batch.get_failed_jobs(zk).length + batch.get_deleted_jobs(zk).length + batch.get_completed_jobs(zk).length
batches.append(batchjson)
rescue StandardError => e
puts "List Batch #{cp} exception: #{e}"
Expand Down

0 comments on commit 83e808d

Please sign in to comment.