Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

RRDTool::OO not able to create a COMPUTE data source?

by bronto (Priest)
on Oct 01, 2010 at 12:35 UTC ( #862962=perlquestion: print w/ replies, xml ) Need Help??
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.

Comment on RRDTool::OO not able to create a COMPUTE data source?
Re: RRDTool::OO not able to create a COMPUTE data source?
by sanju7 (Acolyte) on Oct 04, 2010 at 02:15 UTC

    Hi Bronto:

    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

    #! /usr/bin/perl -w #simple test ABSOLUTE DS use strict; use RRDTool::OO; # creating new rrd object file my $rrd = RRDTool::OO->new( file => "testrrd.rrd" ); # Create a round-robin database $rrd->create( step => 1, # one-second intervals data_source => { name => "mynewDS", type => "ABSOLUTE" }, archive => { rows => 5 });

    This would create a new rrd data file testrrd.rrd with DS the specified DS type.

      Hi

      What do you exactly mean when you say that a COMPUTE and an ABSOLUTE are the same thing? From the rrdcreate man page I'd say they aren't:

      I am new to both rrdtool and RRDTool::OO, so if I am missing something obvious please bear with me and tell me ;)

      Ciao!
      --bronto


      In theory, there is no difference between theory and practice. In practice, there is.
How to create a COMPUTE data source in RRDTool::OO
by bronto (Priest) on Nov 22, 2010 at 14:59 UTC
    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.

    Ciao!
    --bronto


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://862962]
Approved by moritz
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2014-07-30 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls