mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00: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
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue