sort processes by args/pid
Robert 'phaylon' Sedlacek [Fri, 11 May 2012 17:24:03 +0000 (17:24 +0000)]
lib/System/Introspector/Processes.pm

index 9fb0726..4344488 100644 (file)
@@ -58,7 +58,11 @@ sub gather {
             @row{ @names } = @values;
             push @rows, \%row;
         }
-        return { processes => \@rows };
+        return { processes => [ sort {
+            ($a->{args} cmp $b->{args})
+            ||
+            ($a->{pid} <=> $b->{pid})
+        } @rows ] };
     };
 }