run dstat with run_process

It is not clear to me why this can't use run_process?  Currently we
end up with two log-files both with the same thing

- dstat.txt.gz which comes from the "tee" and is symlinked into
  SCREEN_LOGDIR, so gets picked-up by the gate scripts
- screen-dstat.txt.gz which comes from screen_it

Change-Id: I00b9e09b8d44f72ff14e69dc6e4a4bd5e2a0439e
This commit is contained in:
Ian Wienand 2015-04-09 19:57:13 +10:00
parent 156244df1c
commit c00d2a5313

View File

@ -16,34 +16,16 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
# for DSTAT logging
DSTAT_FILE=${DSTAT_FILE:-"dstat.log"}
# start_dstat() - Start running processes, including screen
function start_dstat {
# A better kind of sysstat, with the top process per time slice
DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
if [[ -n ${LOGDIR} ]]; then
screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE"
if [[ -n ${SCREEN_LOGDIR} && ${SCREEN_LOGDIR} != ${LOGDIR} ]]; then
# Drop the backward-compat symlink
ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE
fi
else
screen_it dstat "dstat $DSTAT_OPTS"
fi
run_process dstat "dstat $DSTAT_OPTS"
}
# stop_dstat() stop dstat process
function stop_dstat {
# dstat runs as a console, not as a service, and isn't trackable
# via the normal mechanisms for DevStack. So lets just do a
# killall and move on.
killall dstat || /bin/true
stop_process dstat
}
# Restore xtrace