This evening I’m able to present you “Yet another Screen” (YaS) from Grails Instruments (btw: note that the G has been dropped in favor of ‘Grails’ – I hope this is the last time I rename it).
Here’s the screen:
The cool thing is, the chart is rendered by flot (which I named before). At first I had planned to log the system metrics into a simple csv-file on the server. The logger would get the metrics every 500ms and then dump them to the csv. Not bad at all. It only turned very slow when I was then parsing the csv file in Groovy for the data I needed for drawing the chart – and that was a major performance killer. After caching about 10sec of system metrics the page would refresh after about 1-2sec which is just not fun…
So I went back and created a “specialized” cache class (for performance reasons: in Java) which will hold the metrics for the last 3 minutes (set the interval to 1000ms) in memory. This turned out to be much faster – for later versions there could be some “report functionality” which makes use of the csv-dumps (which will then be re-introduced ;-) ). For the moment the last 3minutes should be enough.
And the last thing I set up for today is the thing transmitting the cached results to the frontend (using json, what else?) and fills the data series for flot – resulting in something like the screen above.
There are plenty of things to be done yet. One thing is adding markings to the chart when certain events happen, … stay tuned, and as always: I’d appreciate your comments!
