Monitoring Hudson CI – Solved!

In an earlier post on our continuous-integration monitoring, I said we were having some challenges in measuring wait time (from checkin to start of build) and build time (from start of build to published result). I’m pleased to report we’ve solved these now, using the clever Hudson Python API.

Hudson has a remarkably discoverable API – to use it, visit the page that shows the data you want, such as

http://myhudson.example.com/job/MyJob

and just add /api on the end:

http://myhudson.example.com/job/MyJob/api

You get a nice page describing what you can do with the API from this page – and one of the choices is to get Python code from a URL like

http://myhudson.example.com/job/MyJob/api/python

Like JSON, you use eval() to convert the code to a Python dictionary that’s easy to use straightaway – no explicit parsing required!

Our CruiseMissile feedback device is written in Python, so it wasn’t hard to get the data we needed about each job and record it in a database (though we did hit some minor snags). Now we run one SQL query and get wait time, build time, and response time for all our builds. Next job is to actually improve those figures, for instance by adding shiny new servers.

Leave a Reply

Your email address will not be published. Required fields are marked *