Make vmstat, iostat, and mpstat run for --run-time not --interval.

This commit is contained in:
Daniel Nichter
2012-03-30 11:35:32 -06:00
parent c19c6caf0b
commit 94d9483d03
3 changed files with 23 additions and 13 deletions

View File

@@ -710,16 +710,16 @@ collect() {
$CMD_SYSCTL -a >> "$d/$p-sysctl" & $CMD_SYSCTL -a >> "$d/$p-sysctl" &
fi fi
if [ "$CMD_VMSTAT" ]; then if [ "$CMD_VMSTAT" ]; then
$CMD_VMSTAT 1 $OPT_INTERVAL >> "$d/$p-vmstat" & $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
$CMD_VMSTAT $OPT_INTERVAL 2 >> "$d/$p-vmstat-overall" & $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
fi fi
if [ "$CMD_IOSTAT" ]; then if [ "$CMD_IOSTAT" ]; then
$CMD_IOSTAT -dx 1 $OPT_INTERVAL >> "$d/$p-iostat" & $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
$CMD_IOSTAT -dx $OPT_INTERVAL 2 >> "$d/$p-iostat-overall" & $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
fi fi
if [ "$CMD_MPSTAT" ]; then if [ "$CMD_MPSTAT" ]; then
$CMD_MPSTAT -P ALL 1 $OPT_INTERVAL >> "$d/$p-mpstat" & $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
$CMD_MPSTAT -P ALL $OPT_INTERVAL 1 >> "$d/$p-mpstat-overall" & $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
fi fi
$CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" & $CMD_MYSQLADMIN $EXT_ARGV ext -i1 -c$OPT_RUN_TIME >>"$d/$p-mysqladmin" &

View File

@@ -148,16 +148,16 @@ collect() {
$CMD_SYSCTL -a >> "$d/$p-sysctl" & $CMD_SYSCTL -a >> "$d/$p-sysctl" &
fi fi
if [ "$CMD_VMSTAT" ]; then if [ "$CMD_VMSTAT" ]; then
$CMD_VMSTAT 1 $OPT_INTERVAL >> "$d/$p-vmstat" & $CMD_VMSTAT 1 $OPT_RUN_TIME >> "$d/$p-vmstat" &
$CMD_VMSTAT $OPT_INTERVAL 2 >> "$d/$p-vmstat-overall" & $CMD_VMSTAT $OPT_RUN_TIME 2 >> "$d/$p-vmstat-overall" &
fi fi
if [ "$CMD_IOSTAT" ]; then if [ "$CMD_IOSTAT" ]; then
$CMD_IOSTAT -dx 1 $OPT_INTERVAL >> "$d/$p-iostat" & $CMD_IOSTAT -dx 1 $OPT_RUN_TIME >> "$d/$p-iostat" &
$CMD_IOSTAT -dx $OPT_INTERVAL 2 >> "$d/$p-iostat-overall" & $CMD_IOSTAT -dx $OPT_RUN_TIME 2 >> "$d/$p-iostat-overall" &
fi fi
if [ "$CMD_MPSTAT" ]; then if [ "$CMD_MPSTAT" ]; then
$CMD_MPSTAT -P ALL 1 $OPT_INTERVAL >> "$d/$p-mpstat" & $CMD_MPSTAT -P ALL 1 $OPT_RUN_TIME >> "$d/$p-mpstat" &
$CMD_MPSTAT -P ALL $OPT_INTERVAL 1 >> "$d/$p-mpstat-overall" & $CMD_MPSTAT -P ALL $OPT_RUN_TIME 1 >> "$d/$p-mpstat-overall" &
fi fi
# Collect multiple snapshots of the status variables. We use # Collect multiple snapshots of the status variables. We use

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
plan 20 plan 21
TMPFILE="$TEST_TMPDIR/parse-opts-output" TMPFILE="$TEST_TMPDIR/parse-opts-output"
TMPDIR="$TEST_TMPDIR" TMPDIR="$TEST_TMPDIR"
@@ -143,6 +143,16 @@ collect "$TMPDIR/collect" "2011_12_05" > $p-output 2>&1
iters=$(cat $p-df | grep -c '^TS ') iters=$(cat $p-df | grep -c '^TS ')
is "$iters" "2" "2 iteration/2s run time" is "$iters" "2" "2 iteration/2s run time"
if [ -f "$p-vmstat" ]; then
n=$(awk '/[ ]*[0-9]/ { n += 1 } END { print n }' "$p-vmstat")
is \
"$n" \
"2" \
"vmstat runs for --run-time seconds (bug 955860)"
else
is "1" "1" "SKIP vmstat not installed"
fi
# ############################################################################ # ############################################################################
# Done # Done
# ############################################################################ # ############################################################################