Just looking for some advice here on a small job I have to do. I’ve been asked to put together a page that displays a graph that updates in real time to show stats obtained from a remote server. It’s worth stating that this will be triggered on demand and will only capture data for a short time (e.g for 5 mins)
The app is based on rails 3 and I already have a class that will ssh to a target grab a value every 30 seconds and append that into an array that I’ll hold in a db table, I’ll use a background resque task to do this on demand
So what I’m looking for is some advice on the best way to display this array in a graph and update the graph data (i.e. grab the updated array from the db every 30 seconds.)
My first thought was to use something like Bluff http://bluff.jcoglan.com/ and just do a full page refresh but I wondered if I could do something nicer and use jQuery or Ajax to reach out and grab the array and refresh the graph in real time without doing a full page refresh.
If anyone has any ideas on the best way to do this I would really appreciate it. I’m fairly open to any suggestions on the best way to hold the data in the db or which graphing software I should use
in the end I used Flot graphs to write out the graph data
http://code.google.com/p/flot/
well worth checking out if you are doing any graphing work