diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-09-16 17:12:25 +0200 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-09-16 17:12:25 +0200 |
commit | b5b7c0f2dc7420cb4c322f571ae16743bd621b39 (patch) | |
tree | c4db951c7da3536a95a8bc51581c44e6501aa767 | |
parent | 246f2b329811de06711d2c60c1010106034a7eec (diff) | |
download | smokeping-b5b7c0f2dc7420cb4c322f571ae16743bd621b39.tar.gz smokeping-b5b7c0f2dc7420cb4c322f571ae16743bd621b39.tar.xz |
* don't complain when there is no data in a graph yet while calculation stddev -- tobi
* in a multihost graph take the number of pings for each component into consideration -- tobi
-rw-r--r-- | CHANGES | 4 | ||||
-rw-r--r-- | lib/Smokeping.pm | 10 | ||||
-rw-r--r-- | lib/Smokeping/Graphs.pm | 2 |
3 files changed, 13 insertions, 3 deletions
@@ -1,4 +1,6 @@ -* fixed problem with rounding error in calculating stddev +* don't complain when there is no data in a graph yet while calculation stddev -- tobi +* in a multihost graph take the number of pings for each component into consideration -- tobi +* fixed problem with rounding error in calculating stddev -- tobi * include the prototype.js license for completeness -- niko * fix Smokeping.pm POD documentation -- niko diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index cb6a0f3..05ace24 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -685,6 +685,7 @@ sub get_overview ($$$$){ my $pings = $probe->_pings($tree->{$prop}); my $i = 0; my @colors = split /\s+/, $cfg->{Presentation}{multihost}{colors}; + my $ProbeUnit = $probe->ProbeUnit(); for my $slave (@slaves){ $i++; my $rrd; @@ -698,7 +699,15 @@ sub get_overview ($$$$){ my ($host,$real_slave) = split /~/, $tree_path[-1]; #/ $tree_path[-1]= $host; my $tree = get_tree($cfg,\@tree_path); + # not all multihost entries must have the same number of pings + $probe = $probes->{$tree->{$prop}{probe}}; + $pings = $probe->_pings($tree->{$prop}); $label = $tree->{menu}; + # if there are multiple units ... lets say so ... + if ($ProbeUnit ne $probe->ProbeUnit()){ + $ProbeUnit = 'var units'; + } + if ($real_slave){ $label .= "<". $cfg->{Slaves}{$real_slave}{display_name}; } @@ -742,7 +751,6 @@ sub get_overview ($$$$){ "GPRINT:avmsr$i:%5.1lf %s am/as\\l"; } - my $ProbeUnit = $probe->ProbeUnit(); my ($graphret,$xs,$ys) = RRDs::graph ($cfg->{General}{imgcache}.$dir."/${prop}_mini.png", # '--lazy', diff --git a/lib/Smokeping/Graphs.pm b/lib/Smokeping/Graphs.pm index f0d7bf7..895e3cb 100644 --- a/lib/Smokeping/Graphs.pm +++ b/lib/Smokeping/Graphs.pm @@ -208,7 +208,7 @@ sub get_multi_detail ($$$$;$){ $label = sprintf("%-20s",$label); push @colors, $medc; my $sdc = $medc; - my $stddev = Smokeping::RRDhelpers::get_stddev($rrd,'median','AVERAGE',$realstart,$sigtime); + my $stddev = Smokeping::RRDhelpers::get_stddev($rrd,'median','AVERAGE',$realstart,$sigtime) || 0; $sdc =~ s/^(......).*/${1}30/; push @G, "DEF:median$i=${rrd}:median:AVERAGE", |