Whamcloud - gitweb
LU-4748 test: get one single qos_threshold_rr number
[fs/lustre-release.git] / lustre / tests / runvmstat
index 6bff5ce..8a5a7df 100755 (executable)
@@ -1,2 +1,24 @@
 #!/bin/sh
-vmstat 1 | while read LINE ; do echo "`date +%H:%M:%S`: $LINE" ; done
+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"
+       [ "$1" ] && echo "$LINE" >> $1
+done