[rrd-developers] rrdtool and object-orientation

Martin Sperl rrdtool at martin.sperl.org
Tue Mar 6 16:40:50 CET 2012


After some discussions with Tobi here an initiative for a broader discussion regarding how to make rrdtool more object orientated.

Maybe first a reason why I am starting this:
I initially started with the idea of implementing different types of graphs - scatter graphs that could get used for correlation of CPU versus TPS or similar to estimate the capacity reserves (See the P.s. for a quick overview what I would like to achieve)
So this would require some changes to the argument parser as well and now after having started with a key-value parser that still does the positional arguments as well I am now getting closer to the point of graphing.
But then while writing the new parser I came to realize that we are carrying a lot of stuff arround that is either not needed (lots of fields in graph_desc_t) and now that I am finally getting closer to adding new types it came to my mind to take the opportunity to also improve the code by converting(the graphing code) to a more object-orientated approach at the same time.

I have been thinking about different options and would like your thoughts of in which directions we should go:
* do an OO approach of our own (maybe following the ideas of: http://www.planetpdf.com/codecuts/pdfs/ooc.pdf)
* using GLIB (with class and interface type), which requires a lot of boilerblade code to get written per class
* using GLIB with a preprocessor like gop2 or Vala
* going with c++
* other options (how do pango and others do it?)

The idea is really to make the code easier to maintain and better localized the code to what is really needed.
THis should also make extending it with new functionality much easier (maybe even allowing for dynamic loading of functions?)

So please share your input on the direction we should be taking here...

Obviously all this would be material possibly for a 2.0 release.


P.s: What in the end my goal would be is configuring a graph like this:

     XAXIS2     XAXIS3
  |          |          | Y
Y |          |          | A
A |          |          | X
X |          |          | 4
3 |          +----------+ 
  |          |  XAXIS3  
  |                     |
Y |                     | Y
A |                     | A
X |                     | X
1 |                     | 2
  |                     |

LINE:data3#ff00ff:data4:xaxis=3:yaxis=4 # to show the old positional parser is still working...

You also see that I would like to be able to use VDEFs to control MIN/MAX of an axis (and use implicit VDEFS for defaults)
Also we should be able to set the type of an axis to value or time, so that we can create different types of graphs.

What also came to my mind is the possibility to decide if we want to print/graph something depending on a vdef (say by LINE:vname=data3:...:if=data,MAX,20,LT - also for gprint or such)
Then we could graph high and low volume data in 2 graphs top/bottom and see any abnormalies in any of those lines.

To implement all this it would obviously make life much easier with some object-orientated design at its base...

Adding another type of chart (say PIE or Histogram) may then be as easy as writing a custom library that gets dynamically loaded...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20120306/93a6d08a/attachment.htm 

More information about the rrd-developers mailing list