Visualize real-time data streams with Gnuplot

Some times when I need to troubleshoot a problem, adding some visualization to the process can help a lot, especially if one need to correlate between 2 (or more) metrics in the data. But you don’t want to mess a round with some monitoring tools, or RRD files. So here is a simple solution I found to collect some stats from a remote server and plot them in real-time by piping them info gnuplot.

At first I cam a cross a small script by Thanassis Tsiodras on his post I though that exacly what is was looking for, but in the end of his post he  mentioning  feedgnuplot created by Dima Kogan which solve the same problem in a different way — which I find more suitable for my case.

I had small script which dump the samples in the following format

So I run my script in a while loop and write the stats into a local file,

And then I use tail -f and pipe the output to the following  feedgnuplot  command,

Which will open a graphs windows, and you can see your data getting plotted over time,

A Graph

Visualize with gnuplot

Resources

  1. https://www.cs.colostate.edu/~cs475/f14/Lectures/Visualize.pdf
  2. http://users.softlab.ntua.gr/~ttsiod/gnuplotStreaming.html
  3. https://github.com/dkogan/feedgnuplot

Related Post

Leave a Reply

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