Adding sysstat monitoring

You can add sysstat logging on the devstack run.
In CI environemnt, sometimes VM creation, Volume creation or
Python unit testing timeouts. It is valuable to monitor
sysstat for investigate the issues.

- How to enable sysstat ( Default is off )
enable_service sysstat

- This commit adds two env variables.
SYSSTAT_FILE : sysstat log file
SYSSTAT_DURATION : duration of sysstat monitoring

Change-Id: I65efb574ef141e6e78c69218f4327df59b3258e2
This commit is contained in:
Nachi Ueno 2013-02-20 11:38:47 -08:00
parent d404c79930
commit e3aaa96a72
4 changed files with 17 additions and 0 deletions

1
files/apts/sysstat Normal file
View File

@ -0,0 +1 @@
sysstat

1
files/rpms-suse/sysstat Normal file
View File

@ -0,0 +1 @@
sysstat

1
files/rpms/sysstat Normal file
View File

@ -0,0 +1 @@
sysstat

View File

@ -268,6 +268,11 @@ SYSLOG=`trueorfalse False $SYSLOG`
SYSLOG_HOST=${SYSLOG_HOST:-$HOST_IP}
SYSLOG_PORT=${SYSLOG_PORT:-516}
# Enable sysstat logging
SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
# Use color for logging output (only available if syslog is not used)
LOG_COLOR=`trueorfalse True $LOG_COLOR`
@ -1274,6 +1279,15 @@ if is_service_enabled nova && is_baremetal; then
screen_it baremetal "nova-baremetal-deploy-helper"
fi
# run sysstat if it is enabled
if is_service_enabled sysstat;then
if [[ -n ${SCREEN_LOGDIR} ]]; then
screen_it sysstat "sar -o $SCREEN_LOGDIR/$SYSSTAT_FILE $SYSSTAT_INTERVAL"
else
screen_it sysstat "sar $SYSSTAT_INTERVAL"
fi
fi
# Save some values we generated for later use
CURRENT_RUN_TIME=$(date "+$TIMESTAMP_FORMAT")
echo "# $CURRENT_RUN_TIME" >$TOP_DIR/.stackenv