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

fix cpu_by_process time parser

cumulated CPU time is in [DD-]hh:mm:ss format
This commit is contained in:
presbrey 2013-04-11 18:31:05 -03:00
parent 463bf9ccc7
commit b63d544551

View File

@ -60,7 +60,12 @@ while (<PS>)
$process =~ tr|a-zA-Z0-9|_|c;
my @times = split /:/, $cputime;
my @days = split /-/, $times[0];
if ($days[1]) {
$cputime = ((($days[0] * 24) + $days[1]) * 60 + $times[1]) * 60 + $times[2];
} else {
$cputime = (($times[0] * 60) + $times[1]) * 60 + $times[2];
}
$total_cpu_by_process{$process} += $cputime;
}