Nigel Babu: The story of hgstats |
tl;dr: I built a thing to see public graphs of hg.mozilla.org called hgstats.
Lately, we’ve had problems with Mercurial at Mozilla. The Developer Services Team added a bunch of instrumentation to the hg webheads to help us track what is going wrong and when, to give us somewhat an early indicator of when things get shot to hell. All of these are on the Mozilla Graphite instance which are behind employee-only LDAP. However, an interesting quirk is that the image rendering is actually available without authentication. As a community Sheriff, I’ve been keeping close watch on hg throughout my shift with images that releng folks or hwine gave me. This gave an indicator of when to close trees so that we don’t end up having everything turn red. On Thursday evening, I was watching the conversation in #vcs on irc.mozilla.org, when bkero mentioned he’d made a dashboard in graphite. It suddenly dawned on me that I could just embed those images onto a page and quickly have a public dashboard!
Armed with a bunch of images from Ben, I created a github pages repo with a lovely theme that’s available by default. I embedded the images onto a static HTML page and suddenly, we had a minimal dashboard. It wouldn’t auto-refresh or let you alter the duration of the graph, but hey, now we had one place for things! This first step took about 15 minutes.
There were two features I had in my mind as must-haves: a) the page must let me change the hours of the graphs (i.e. last 2 hours, last 4 hours, last 8 hours, etc), and b) it should auto-refresh. I’ve looked at backbone several times in the past and I figured this was a good time as any to get cracking on building a backbone.js app.
I started slowly, the first step was, get everything I have right now, rendered
with backbone. I spent a lot of frustrating hours trying to get it to work, but
couldn’t because of silly mistakes. I haven’t been coding in JS much and it
shows :) I think I stayed up until 2 am trying to diagnose it, but I couldn’t.
When I woke up in the morning, I spotted the trouble immediately and it was
a tiny typo. Instead of
Комментировать | « Пред. запись — К дневнику — След. запись » | Страницы: [1] [Новые] |