From: Sebastian Harl Date: Wed, 14 Nov 2012 18:00:25 +0000 (+0100) Subject: Collectd.pm: Use plugin_get_interval() rather than $interval_g. X-Git-Tag: collectd-5.2.0~20^2~5 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cbbb31b0e8ecd46a4ba4f7734419b33e1c74c6d9;p=collectd.git Collectd.pm: Use plugin_get_interval() rather than $interval_g. --- 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, );