1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 02:18:08 +00:00

Merge pull request #292 from presbrey/patch-1

fix cpu_by_process time parser
This commit is contained in:
Kenyon Ralph 2013-04-19 14:28:51 -07:00
commit bc0bab7a0e

View file

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