This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kibble-scanners.git


The following commit(s) were added to refs/heads/master by this push:
     new b684c79  also count jobs building at the moment
b684c79 is described below

commit b684c79b0009f9aa8e148cdf7fe3e035cd6cda03
Author: Daniel Gruno <humbed...@apache.org>
AuthorDate: Mon Feb 19 12:56:12 2018 +0100

    also count jobs building at the moment
---
 src/plugins/scanners/jenkins.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/plugins/scanners/jenkins.py b/src/plugins/scanners/jenkins.py
index 7d927e3..071a5f0 100644
--- a/src/plugins/scanners/jenkins.py
+++ b/src/plugins/scanners/jenkins.py
@@ -220,11 +220,18 @@ def scan(KibbleBit, source):
         
         avgqueuetime = totalqueuetime / max(1, len(items))
         
+        # Count how many jobs are building
+        building = 0
+        for job in jobsjs.get('jobs', []):
+            if 'anime' in job['color']: # a running job will have foo_anime as 
color
+                building += 1
+        
         # Write up a queue doc
         queuedoc = {
             'id': queuehash,
             'date': time.strftime("%Y/%m/%d %H:%M:%S", time.gmtime(NOW)),
             'time': NOW,
+            'building': building,
             'size': len(items),
             'blocked': blocked,
             'stuck': stuck,
@@ -238,6 +245,7 @@ def scan(KibbleBit, source):
         }
         KibbleBit.append('ci_queue', queuedoc)
         
+        
         pendingJobs = jobsjs.get('jobs', [])
         KibbleBit.pprint("Found %u jobs in Jenkins" % len(pendingJobs))
         

-- 
To stop receiving notification emails like this one, please contact
humbed...@apache.org.

Reply via email to