From 1124a055711c01ad61da8063de47eed9d9acffeb Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 11 Feb 2019 13:35:43 +1100 Subject: [PATCH] Handle pcp-dstat transition dstat is Python 2, never going to be updated and effectively abandonded. The replacement is pcp-dstat [1] which is mostly compatible, with a few differences. As distro start transitioning (Fedora has), just drop the unsupported args for now. [1] https://pcp.io/man/man1/pcp-dstat.1.html Change-Id: Ibec8a37cb18a14656d97e2096c66bc8b21406068 --- tools/dstat.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/dstat.sh b/tools/dstat.sh index 01c6d9b7e9..e6cbb0f21c 100755 --- a/tools/dstat.sh +++ b/tools/dstat.sh @@ -12,8 +12,17 @@ # Retrieve log directory as argument from calling script. LOGDIR=$1 +DSTAT_TOP_OPTS="--top-cpu-adv --top-io-adv --top-mem" +if dstat --version | grep -q 'pcp-dstat' ; then + # dstat is unmaintained, and moving to a plugin of performance + # co-pilot. Fedora 29 for example has rolled this out. It's + # mostly compatible, except for a few options which are not + # implemented (yet?) + DSTAT_TOP_OPTS="" +fi + # Command line arguments for primary DStat process. -DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv --top-mem --swap --tcp" +DSTAT_OPTS="-tcmndrylpg ${DSTAT_TOP_OPTS} --swap --tcp" # Command-line arguments for secondary background DStat process. DSTAT_CSV_OPTS="-tcmndrylpg --tcp --output $LOGDIR/dstat-csv.log"