Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?

Replies are listed 'Best First'.
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?
[marto]: what a mess
[karlgoethebier]: perhaps i need a zerial?
[Corion]: marto: Heh - I think that's a nice contractual trap, "you will not use other gods/engines besides ours" ;)
[Corion]: But if the base intention was to have CIG as "co-developers" who (have to) contribute changes back to the mainline, it makes sense to have them use no other engine
[marto]: yes, I hear that development house has been on its last legs for a couple of years now
[Corion]: Is anybody aware of what makes Android Oreo better than Android Nougat? I'm not sure if the architectural changes (etc) are there already that make upgrading an Oreo-kernel phone to a newer Android userland (Lineage OS) version feasible
[Corion]: Yeah, CryTek got blindsided (or whatever) by Unity and Unreal Engine being zero cost, and the CryTek documentation being bad/nonexistent I think
[Corion]: "zero monetary cost", because of course, it's gratis only if your time has no value :)
[marto]: I used to keep up to date with my android ROMs, updating to the nightly every other day

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-12-14 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (389 votes). Check out past polls.

    Notices?