Fix dstat options

--top-io-adv and --top-cpu-adv aren't options in c8, so let's make their
usage dynamic

Change-Id: I1fc97d77311763d972b2da925f87d09caa9b21ee
(cherry picked from commit 47e6112570)
This commit is contained in:
Alex Schultz 2021-07-21 14:56:42 -06:00 committed by Takashi Kajinami
parent 420cf20f98
commit 3c099fabfb
1 changed files with 11 additions and 1 deletions

View File

@ -162,7 +162,17 @@ fi
# use dstat to monitor system activity during integration testing
if type "dstat" 2>/dev/null; then
print_header 'Start dstat'
$SUDO dstat -tcmndrylpg --top-cpu-adv --top-io-adv --nocolor | $SUDO tee --append /var/log/dstat.log > /dev/null &
DSTAT_OPTS=""
set -e
if dstat --help 2>&1 | grep -q "top-io-adv"; then
DSTAT_OPTS="${DSTAT_OPTS} --top-io-adv"
fi
if dstat --help 2>&1 | grep -q "top-cpu-adv"; then
DSTAT_OPTS="${DSTAT_OPTS} --top-cpu-adv"
fi
set +e
$SUDO dstat -tcmndrylpg $DSTAT_OPTS --nocolor | $SUDO tee --append /var/log/dstat.log > /dev/null &
fi
if type "iostat" 2>/dev/null; then