2
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #550 from bhourigan/master

Apache response time was incorrectly divided by 1000 twice, fixed that b...
This commit is contained in:
Steve Schnepp 2014-11-28 21:00:03 +00:00
commit 8e18199f16

View file

@ -40,7 +40,6 @@ while (<STDIN>) {
# sanity check # sanity check
next unless m/^([\d\w\.\-_]+\s){5}([\d\w\.\-_]+$)/; # escaped "." and "-" next unless m/^([\d\w\.\-_]+\s){5}([\d\w\.\-_]+$)/; # escaped "." and "-"
$time=sprintf("%d",$time/1000); # microsec to millisec
# sitename to munin fieldname # sitename to munin fieldname
my $vpm=clean_fieldname($vhost); my $vpm=clean_fieldname($vhost);
@ -66,9 +65,6 @@ while (<STDIN>) {
$temp{$vpm}{"status"}{$status}++ if $status; $temp{$vpm}{"status"}{$status}++ if $status;
if ($time) { if ($time) {
# microsec to millisec
$time=sprintf("%d",$time/1000);
# min/max execution time # min/max execution time
$temp{$vpm}{'max_time'}=max($temp{$vpm}{'max_time'},$time); $temp{$vpm}{'max_time'}=max($temp{$vpm}{'max_time'},$time);
@ -93,8 +89,8 @@ sub periodic_write {
$old{$vpm}{'requests'}+=$temp{$vpm}{'requests'} if $temp{$vpm}{'requests'}; $old{$vpm}{'requests'}+=$temp{$vpm}{'requests'} if $temp{$vpm}{'requests'};
$old{$vpm}{'time'}+=$temp{$vpm}{'time'} if $temp{$vpm}{'time'}; $old{$vpm}{'time'}+=$temp{$vpm}{'time'} if $temp{$vpm}{'time'};
$old{$vpm}{'label'}=$temp{$vpm}{'label'}; $old{$vpm}{'label'}=$temp{$vpm}{'label'};
$old{$vpm}{'avg_time'}=sprintf("%d",($old{$vpm}{'avg_time'}+$temp{$vpm}{'avg_time'})/2); $old{$vpm}{'avg_time'}=sprintf("%d",(($old{$vpm}{'avg_time'}+$temp{$vpm}{'avg_time'})/2)/1000);
$old{$vpm}{'max_time'}=max($old{$vpm}{'max_time'},$temp{$vpm}{'max_time'}); $old{$vpm}{'max_time'}=max($old{$vpm}{'max_time'},$temp{$vpm}{'max_time'})/1000;
$old{$vpm}{'max_bytes'}=max($temp{$vpm}{'max_bytes'},$temp{$vpm}{'max_bytes'}); $old{$vpm}{'max_bytes'}=max($temp{$vpm}{'max_bytes'},$temp{$vpm}{'max_bytes'});
$old{$vpm}{'avg_bytes'}=sprintf("%d",($old{$vpm}{'avg_bytes'}+$temp{$vpm}{'avg_bytes'})/2); $old{$vpm}{'avg_bytes'}=sprintf("%d",($old{$vpm}{'avg_bytes'}+$temp{$vpm}{'avg_bytes'})/2);