Skip to content
Snippets Groups Projects
Commit 5e2652ce authored by Sergey Joseph Ivanov's avatar Sergey Joseph Ivanov
Browse files

fix: return 0 if no process found

parent e6878194
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,13 @@ sub handler { ...@@ -63,7 +63,13 @@ sub handler {
my @values = split(/\n/, $output); my @values = split(/\n/, $output);
my $title = shift @values; my $title = shift @values;
my @sorted = sort @values; my @sorted = sort @values;
my $value = ( $aggr eq 'max' ) ? pop @sorted : shift @sorted; my $value;
if (scalar @value) {
$value = ( $aggr eq 'max' ) ? pop @sorted : shift @sorted;
}
else {
$value = 0
}
return { return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment