summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea4449a)
raw | patch | inline | side by side (parent: ea4449a)
author | Sebastian Harl <sh@tokkee.org> | |
Tue, 29 Jan 2008 01:12:17 +0000 (02:12 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Mon, 4 Feb 2008 16:40:24 +0000 (17:40 +0100) |
The hard-coded value was still legacy code from the time before the global
variables have been exported to Perl.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
variables have been exported to Perl.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Florian Forster <octo@huhu.verplant.org>
bindings/perl/Collectd.pm | patch | blob | history |
index fc4a69dc8eb60c7810fa5a3d72ad30e98e73afbb..43775706c3b8ccc6af6929a0d623b7145496f692 100644 (file)
foreach keys %EXPORT_TAGS;
}
+# global variables
+our $hostname_g;
+our $interval_g;
+
Exporter::export_ok_tags ('all');
my @plugins : shared = ();
my $status = 0;
if ($p->{'wait_left'} > 0) {
- # TODO: use interval_g
- $p->{'wait_left'} -= 10;
+ $p->{'wait_left'} -= $interval_g;
}
next if ($p->{'wait_left'} > 0);
if ($status) {
$p->{'wait_left'} = 0;
- $p->{'wait_time'} = 10;
+ $p->{'wait_time'} = $interval_g;
}
elsif (TYPE_READ == $type) {
- WARNING ("${plugin}->read() failed with status $status. "
- . "Will suspend it for $p->{'wait_left'} seconds.");
+ if ($p->{'wait_time'} < $interval_g) {
+ $p->{'wait_time'} = $interval_g;
+ }
$p->{'wait_left'} = $p->{'wait_time'};
$p->{'wait_time'} *= 2;
if ($p->{'wait_time'} > 86400) {
$p->{'wait_time'} = 86400;
}
+
+ WARNING ("${plugin}->read() failed with status $status. "
+ . "Will suspend it for $p->{'wait_left'} seconds.");
}
elsif (TYPE_INIT == $type) {
ERROR ("${plugin}->init() failed with status $status. "
$data = $pkg . "::" . $data;
}
- # TODO: make interval_g available at configuration time
%p = (
- wait_time => 10,
+ wait_time => $interval_g,
wait_left => 0,
cb_name => $data,
);