bronto has asked for the
wisdom of the Perl Monks concerning the following question:

I recently started using RRDtool, and I wanted to take advantage of the module RRDTool::OO. However, I find no way to create a COMPUTE data source. A peek in the source seems to confirm that this was not implemented.

The author says

For the experienced user, however, it provides full access to rrdtool's API (if you find a feature that's not implemented, let me know).

So, before posting him a bug or something, I would like to check with you if I am right or wrong. Can you confirm that you can't create a COMPUTE data source in RRDTool::OO other than accessing the API directly?

Thanks

Ciao!--bronto

In theory, there is no difference between theory and practice. In practice, there is.

I am not sure if i get it right if you are specifying something else than creating a data source (DS) using "RRDTool::OO". If not then my bad but If that is creating a COMPUTE DS then its pretty straight forward . COMPUTE data source is nothing but data source type ABSOLUTE. This is the same way i create a GAUGE data source using RRDTool::OO

OK, I found out that there is not a way to create a COMPUTE resource out of the box in RRDTool::OO, but it is possible to workaround this lack of functionality by using the dry run mode. Here is how.

First, you need to create an RRDTool::OO object in dry run mode. Then you prepare all the "standard" data sources in the usual way, and call create. It won't actually execute the call, but now you can retrieve a reference to the function that it would have called, along with a reference to the function arguments. You can now fiddle with the arguments and call the function when you are ready.