We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9744e78 + aa60711 commit 6ffec49Copy full SHA for 6ffec49
1 file changed
jenkins_exporter/jenkins_exporter.py
@@ -50,7 +50,10 @@ def collect(self):
50
name = job['name']
51
for s in statuses:
52
# If there's a null result, we want to export zeros.
53
- status = job[s] or {}
+ if s in job and job[s]:
54
+ status=job[s]
55
+ else:
56
+ status={}
57
metrics[s]['number'].add_metric([name], status.get('number', 0))
58
metrics[s]['duration'].add_metric([name], status.get('duration', 0) / 1000.0)
59
metrics[s]['timestamp'].add_metric([name], status.get('timestamp', 0) / 1000.0)
0 commit comments