Repository: buildbot/buildbot

Issue:
New web plugin idea: a health indicator
This ticket is a migrated Trac ticket [2966](http://trac.buildbot.net/ticket/2966)

People contributed to the original ticket: `benoit.allard@...`, @tardyp, @rutsky, @unknown_contributor, @sa2ajj, @rutsky
Ticket created on: `Oct 24 2014`
Ticket last modified on: `Mar 19 2016`

---

I like to extract as much useful indicator from my builds as possible (time, but also amount of warnings, and such ...)

It would be cool to have a web plugin that could print the evolution of my indicators over time ! (Of course, I would have to configure which indicator I want to see plotted, maybe the kind of plot, and so on ...)


---

_Comment from_: @sa2ajj
_Date_: `Oct 24 2014`

Could you please elaborate or provide a more specific example?

I think it's related to the [[metrics support|http://docs.buildbot.net/latest/developer/metrics.html]], but without an example I can easily be wrong :)

---
_Comment from_: @Ben
_Date_: `Oct 24 2014`

I was more aiming at [[Statistics|http://docs.buildbot.net/latest/developer/cls-buildsteps.html?highlight=statistics#buildbot.process.buildstep.[[BuildStep]].hasStatistic]], but I just realized that

   Note that statistics are not preserved after a build is complete.

So metrics is probably where we want to interface with the master.

I used to abuse Properties for that purpose ...

---
_Comment from_: @tardyp
_Date_: `Oct 24 2014`

Buildbot plugin system is really made for enabling such dashboards.

A web ui plugin is not technically restricted to creating a bunch of js file, it could also create a twisted service.

For me having the JS only use existing data api to query the data will be very inefficient. I think we could easily create a service, like a status service that registers to a bunch of mq events, and create statistics based on that.

I also had in mind that plugins could have some table in the DB they could use to store the data, or maybe use another db configuration with all schema + migration stuff separated.


---
_Comment from_: @tardyp
_Date_: `Oct 26 2014`

on IRC, sa2ajj talked about http://graphite.readthedocs.org/

He told us, he actually uses it at work, and has integration working with eigth.

Looking at the documentation, the first reaction is how to integrate this with multimaster, as graphite has its own db called whisper.
I haven't look too much deeply, but I think this is still feasible as a external tool. Probably this would be much cheaper than making our own metrics system inside buildbot.

An external graphite server could be setup, and watch for the (TBD) mq server. As there are messages for nearly every kind of activity that happens in buildbot, this is a good mean of making solid analysis of what is going on. Of course, this solution would not be fully integrated, as probably the UI would be external, but anyway, I think this is a possible cheap path.

@sa2ajj do you think it is possible? How would you estimate the cost of integration?




---
_Comment from_: @Ben
_Date_: `Oct 26 2014`

There are a lot of [[interfaces|http://graphite.readthedocs.org/en/latest/tools.html#visualization]], as well as data collectors / forwarders (same page, a bit higher) available for graphite. It looks like some of them are js-only ! Still way to go for a www-plugin !

---
_Comment from_: @sa2ajj
_Date_: `Oct 27 2014`

What I said was that we indeed use graphite, but I did not say we use it with Buildbot.

I have an oldish branch where I tried to publish metrics to graphite.  However I stopped working on that when I realised that it's not very straightforward to implement it to support multi-master case.

If there's an interest, I can revive the branch or, at least, publish what I have (after rebasing the latest master) so other could comment in what direction my thinking worked.

---
_Comment from_: @unknown_contributor
_Date_: `Mar 19 2016`

+1 for this feature. I suggest to merge the statistic API with the [[stats module|https://github.com/buildbot/buildbot/tree/master/master/buildbot/statistics]] developed last year by my GSOC student. And add a default backend that store a subset of these stat in the main database that would enable the development of heath/stats visualization modules directly installed by default (using Highchart js lib for example) 




Discussion:

Resolving patch:
diff --git a/pkg/setup.py b/pkg/setup.py
--- a/pkg/setup.py
+++ b/pkg/setup.py
@@ -19,7 +19,7 @@
 import buildbot_pkg
 
 setup(
-    name='buildbot_pkg',
+    name='buildbot-pkg',
     version=buildbot_pkg.getVersion("."),
     description='Buildbot packaging tools',
     author=u'Pierre Tardy',


Test patch: