Subject: | Allow the usage of updatev command |
Hi,
a week ago I did send this patch via mail to you -- just in case you
didn't receive it because of spam-filters or some other reason I
attach it here as a wishlist item.
If you ignored my mail on purpose (because the patch isn't up to some
standard), please excuse my pestering you again and feel free to
ignore/wontfix this item, otherwise I hope I reach you via this route.
I want to be able to use updatev instead of update, I implemented it
according to your implementation of graphv - the patched version is in
use here and works (up to now) as expected.
Kind regards,
Tom Regner
Subject: | OO.pm-updatev.patch |
*** OO.pm.bak 2010-02-05 09:52:35.000000000 +0100
--- OO.pm 2010-02-05 10:40:21.000000000 +0100
***************
*** 7,13 ****
use RRDs;
use Log::Log4perl qw(:easy);
! our $VERSION = '0.28';
# Define the mandatory and optional parameters for every method.
our $OPTIONS = {
--- 7,13 ----
use RRDs;
use Log::Log4perl qw(:easy);
! our $VERSION = '0.29';
# Define the mandatory and optional parameters for every method.
our $OPTIONS = {
***************
*** 142,147 ****
--- 142,148 ----
create => \&RRDs::create,
fetch => \&RRDs::fetch,
update => \&RRDs::update,
+ updatev => \&RRDs::updatev,
graph => \&RRDs::graph,
graphv => \&RRDs::graphv,
info => \&RRDs::info,
***************
*** 480,487 ****
$update_string .= $options_hash{value};
}
! $self->RRDs_execute("update", $self->{file},
! @update_options, $update_string);
}
#################################################
--- 481,505 ----
$update_string .= $options_hash{value};
}
! my $caller = (caller(1))[3] ? (caller(1))[3] : '';
! my $updatecmd = $caller eq __PACKAGE__."::updatev" ? 'updatev' : 'update';
! my ($print_results) =
! $self->RRDs_execute($updatecmd, $self->{file},
! @update_options, $update_string);
!
! if(!defined $print_results) {
! return undef;
! }
!
! $self->print_results( $print_results );
!
! return 1;
! }
!
! #################################################
! sub updatev {
! #################################################
! &update (@_);
}
#################################################
***************
*** 1341,1346 ****
--- 1359,1370 ----
C<RRDTool::OO> will transform this automagically
into C<RRDTool's> I<template> syntax.
+ =item I<$rrd-E<gt>updatev( ... )>
+
+ This is identical to C<update>, but uses rrdtool's updatev function internally.
+ The only difference is when using the C<print_results> method described below, which
+ then contains additional information.
+
=item I<$rrd-E<gt>fetch_start( ... )>
Initializes the iterator to fetch data from the RRD. This works nicely without