From cbbb31b0e8ecd46a4ba4f7734419b33e1c74c6d9 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 14 Nov 2012 19:00:25 +0100 Subject: [PATCH] Collectd.pm: Use plugin_get_interval() rather than $interval_g. --- bindings/perl/lib/Collectd.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bindings/perl/lib/Collectd.pm b/bindings/perl/lib/Collectd.pm index 251412cf..c1adf442 100644 --- a/bindings/perl/lib/Collectd.pm +++ b/bindings/perl/lib/Collectd.pm @@ -172,6 +172,7 @@ sub plugin_call_all { my $type = shift; my %plugins; + my $interval; our $cb_name = undef; @@ -195,13 +196,15 @@ sub plugin_call_all { %plugins = %{$plugins[$type]}; } + $interval = plugin_get_interval (); + foreach my $plugin (keys %plugins) { my $p = $plugins{$plugin}; my $status = 0; if ($p->{'wait_left'} > 0) { - $p->{'wait_left'} -= $interval_g; + $p->{'wait_left'} -= $interval; } next if ($p->{'wait_left'} > 0); @@ -228,11 +231,11 @@ sub plugin_call_all { if ($status) { $p->{'wait_left'} = 0; - $p->{'wait_time'} = $interval_g; + $p->{'wait_time'} = $interval; } elsif (TYPE_READ == $type) { - if ($p->{'wait_time'} < $interval_g) { - $p->{'wait_time'} = $interval_g; + if ($p->{'wait_time'} < $interval) { + $p->{'wait_time'} = $interval; } $p->{'wait_left'} = $p->{'wait_time'}; @@ -314,7 +317,7 @@ sub plugin_register { } %p = ( - wait_time => $interval_g, + wait_time => plugin_get_interval (), wait_left => 0, cb_name => $data, ); -- 2.11.0