X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Frunvmstat;h=8a5a7df7c532754eb012f8f275fe78ddb83292de;hb=b78fb445555916e380b1661546c821df14098596;hp=1030930b8cf40161a4d488a2cac077c0a30a32a2;hpb=c5050e412572b00cbe93d8517d2d1f767bebfa92;p=fs%2Flustre-release.git diff --git a/lustre/tests/runvmstat b/lustre/tests/runvmstat index 1030930..8a5a7df 100755 --- a/lustre/tests/runvmstat +++ b/lustre/tests/runvmstat @@ -1,17 +1,23 @@ #!/bin/sh +DELAY=1 null() { : } -if [ $1 == "-q" ]; then - echo "echo off" +case "$1" in +-q) echo "echo off" ECHO="null" - shift -else + shift ;; +[1-9]*) + DELAY=$1 + ECHO=echo + shift ;; +*) echo "echo on" ECHO=echo -fi -vmstat 1 | while read LINE ; do +esac + +vmstat $DELAY | while read LINE ; do LINE="`date +%s`: $LINE" $ECHO "$LINE" [ "$1" ] && echo "$LINE" >> $1