Skip to content

Commit

Permalink
- enable vectorized multiple-time updates
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschnepp committed May 21, 2010
1 parent ad0a431 commit a588508
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions master/lib/Munin/Master/UpdateWorker.pm
Expand Up @@ -714,6 +714,7 @@ sub _update_rrd_file {
# Some kind of mismatch between fetch and config can cause this.
return if !defined($values);

my @update_rrd_data;
for (my $i = 0; $i < scalar @$values; $i++) {
my $value = $values->[$i];
my $when = $ds_values->{when}[$i];
Expand All @@ -730,13 +731,16 @@ sub _update_rrd_file {
$value = sprintf("%.4f", $value);
}
}

# Schedule for addition
push @update_rrd_data, "$when:$value";
}

DEBUG "[DEBUG] Updating $rrd_file with $when:$value";
RRDs::update($rrd_file, "$when:$value");
if (my $ERROR = RRDs::error) {
#confess Dumper @_;
ERROR "[ERROR] In RRD: Error updating $rrd_file: $ERROR";
}
DEBUG "[DEBUG] Updating $rrd_file with @update_rrd_data";
RRDs::update($rrd_file, @update_rrd_data);
if (my $ERROR = RRDs::error) {
#confess Dumper @_;
ERROR "[ERROR] In RRD: Error updating $rrd_file: $ERROR";
}
}

Expand Down

0 comments on commit a588508

Please sign in to comment.