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:
parent
463bf9ccc7
commit
b63d544551
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user