Friday, 30 April 2010

Improving your monitoring applications with Gnuplot

Why bother about building a plotting component when you could use a very good one from a third-party? That's what I thought while I was trying to build a plotting component for monitoring my applications. Then I remembered when I was doing some practices with Octave at college and when I was playing with it I thought that it was a very good application.
Afterwards I modified my log and monitoring files for adapting them to gnuplot, a portable command-line driven graphing utility for linux, OS/2, MS Windows, OSX, VMS, and many other platforms. With this, you only need to focus on writing the log files, and let gnuplot draw your files in nice plotting windows with a lot of powerful features like moving axes, changing the view, etc.
With simple commands like these:

C:\>gnuplot         G N U P L O T         Version 4.4 patchlevel 0         last modified March 2010         System: MS-Windows 32 bit         Copyright (C) 1986-1993, 1998, 2004, 2007-2010         Thomas Williams, Colin Kelley and many others         gnuplot home:     http://www.gnuplot.info         faq, bugs, etc:   type "help seeking-assistance"         immediate help:   type "help"         plot window:      hit 'h' Terminal type set to 'wxt' gnuplot> set isosample 40 gnuplot> set ticslevel 0 gnuplot> splot (x**2)*(y**2)
we can draw amazing plots like this:

And even better, if for example we are monitoring our cpu, then we can plot the results:


Now, you only need to know how the command line works and use it in your applications. I'm sure you'll enjoy it, and the best part is that you can save time.

Related Articles:

0 comments:

Post a Comment