devstack/tools/dstat.sh
melanie witt fc572a5da0 Add --tcp option to dstat command for connection stats
This enables tcp stats (listen, established, syn, time_wait, close) in
dstat to allow us to get a high-level view of performance changes in
the system during gate runs.

Change-Id: Ifbffbed22446e7e6a3b825c18266b63d2f2e7718
2017-05-17 19:05:56 +00:00

33 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
# **tools/dstat.sh** - Execute instances of DStat to log system load info
#
# Multiple instances of DStat are executed in order to take advantage of
# incompatible features, particularly CSV output and the "top-cpu-adv" and
# "top-io-adv" flags.
#
# Assumes:
# - dstat command is installed
# Retrieve log directory as argument from calling script.
LOGDIR=$1
# Command line arguments for primary DStat process.
DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv --top-mem --swap --tcp"
# Command-line arguments for secondary background DStat process.
DSTAT_CSV_OPTS="-tcmndrylpg --tcp --output $LOGDIR/dstat-csv.log"
# Execute and background the secondary dstat process and discard its output.
dstat $DSTAT_CSV_OPTS >& /dev/null &
# Execute and background the primary dstat process, but keep its output in this
# TTY.
dstat $DSTAT_OPTS &
# Catch any exit signals, making sure to also terminate any child processes.
trap "kill -- -$$" EXIT
# Keep this script running as long as child dstat processes are alive.
wait