sensu-plugins / sensu-plugins-jenkins

This plugin provides native Jenkins instrumentation for monitoring and metrics collection, including: health, job status, metrics via `JQS`, and others.
http://sensu-plugins.io
MIT License
9 stars 18 forks source link

Provide mode to check build durations #35

Closed CoRfr closed 6 years ago

CoRfr commented 6 years ago

This adds a mode so that check-jenkins-build-time can check the build duration instead of when a build last occured.

The goal is to monitor the performance of some jobs.

Signed-off-by: Bertrand Roussel broussel@sierrawireless.com

Pull Request Checklist

Is this in reference to an existing issue?

General

New Plugins

Purpose

Known Compatibility Issues

CoRfr commented 6 years ago

Sample result:

Passed:

$ check-jenkins-build-time.rb -u 'http://jenkins-cnt:8080/' --jobs 'Legato-Review=1h' --check-build-duration
JenkinsBuildTime OK: 1 job(s) had successful builds within allowed times

Failed:

$ check-jenkins-build-time.rb -u 'http://jenkins-cnt:8080/' --jobs 'Legato-Review=30m' --check-build-duration
JenkinsBuildTime CRITICAL: 1 failure(s): Legato-Review: last built at 2018-05-10 01:47:18 +0000 (33 mins 41 secs) exceeded max duration = 30m
majormoses commented 6 years ago

released: https://rubygems.org/gems/sensu-plugins-jenkins/versions/1.7.0