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