author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 2 Apr 2016 13:14:29 +0000 (15:14 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 2 Apr 2016 13:14:29 +0000 (15:14 +0200) |
Collection3: Graphing speed improvements with many hosts
contrib/collection3/lib/Collectd/Graph/Common.pm | patch | blob | history |
diff --git a/contrib/collection3/lib/Collectd/Graph/Common.pm b/contrib/collection3/lib/Collectd/Graph/Common.pm
index cc7e141f8828380fb8978c796faf4df46f4c6653..31c530f466987f403b76db500a117a9cb1b5a085 100644 (file)
my $ident = shift;
my $all_files;
my @ret = ();
+ my $temp;
+ my $hosts;
my $cache_key = ident_to_string ($ident);
if (defined ($Cache->{'get_files_by_ident'}{$cache_key}))
return ($ret)
}
- $all_files = _get_all_files ();
+ if ($ident->{'hostname'})
+ {
+ $all_files = [];
+ $hosts = $ident->{'hostname'};
+ foreach (@$hosts)
+ {
+ $temp = get_files_for_host ($_);
+ push (@$all_files, @$temp);
+ }
+ }
+ else
+ {
+ $all_files = _get_all_files ();
+ }
@ret = grep { _filter_ident ($ident, $_) == 0 } (@$all_files);