ad5cc986d8
This renames the log files in logs/screen that contain timestamps to put the timestamp after '.log' and '.log.summary' in the names. This will simplify devstack-gate's search for log files to copy to '*.log'. dstat.txt is also renamed to dstat.log Make LOGDIR and LOGFILE local bp:devstack-logging-and-service-names Change-Id: I02aba9ca82c117a1186dafc1d3c07aa04ecd1dde
44 lines
847 B
Bash
44 lines
847 B
Bash
#!/bin/bash
|
|
#
|
|
# lib/dstat
|
|
# Functions to start and stop dstat
|
|
|
|
# Dependencies:
|
|
#
|
|
# - ``functions`` file
|
|
|
|
# ``stack.sh`` calls the entry points in this order:
|
|
#
|
|
# - start_dstat
|
|
# - stop_dstat
|
|
|
|
# Save trace setting
|
|
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 ${SCREEN_LOGDIR} ]]; then
|
|
screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $SCREEN_LOGDIR/$DSTAT_FILE"
|
|
else
|
|
screen_it dstat "dstat $DSTAT_OPTS"
|
|
fi
|
|
}
|
|
|
|
# stop_dstat() stop dstat process
|
|
function stop_dstat {
|
|
screen_stop dstat
|
|
}
|
|
|
|
# Restore xtrace
|
|
$XTRACE
|