src/parallel: vmstat for 17 columns.

Rhys Ulerich's vmstat version has 17 columns.

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b swpd   free   buff    cache   si   so    bi    bo in   cs us sy id wa st
 0  0    0 587736 320220 62341788    0    0    20    36  1    1  4  0 95  0  0
This commit is contained in:
Ole Tange 2012-10-25 01:03:59 +02:00
parent c49e7b4842
commit f42a5c32ba

View file

@ -606,7 +606,7 @@ sub get_options_from_array {
sub parse_options { sub parse_options {
# Returns: N/A # Returns: N/A
# Defaults: # Defaults:
$Global::version = 20121022; $Global::version = 20121023;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -2335,7 +2335,7 @@ sub swap_activity {
# swap_in and swap_out on GNU/Linux is $7 and $8 # swap_in and swap_out on GNU/Linux is $7 and $8
# swap_in and swap_out on Mac is $10 and $11 # swap_in and swap_out on Mac is $10 and $11
$swap_activity = q[ { vmstat 1 2 2> /dev/null || vm_stat 1; } | ]. $swap_activity = q[ { vmstat 1 2 2> /dev/null || vm_stat 1; } | ].
q[ awk 'NR!=4{next} NF==16{print $7*$8} NF==11{print $10*$11} {exit}' ]; q[ awk 'NR!=4{next} NF==17||NF==16{print $7*$8} NF==11{print $10*$11} {exit}' ];
if($self->{'string'} ne ":") { if($self->{'string'} ne ":") {
$swap_activity = $self->sshcommand() . " " . $self->serverlogin() . " " . $swap_activity = $self->sshcommand() . " " . $self->serverlogin() . " " .
::shell_quote_scalar($swap_activity); ::shell_quote_scalar($swap_activity);