From bdeadf59d4273515df0f47edb820ff159bbc5380 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Thu, 23 Jan 2014 17:41:18 +0000 Subject: [PATCH] Add pidstat support pidstat is a script that comes from sysstat, but will give us per-process information. Allow enabling "pidstat" that will run pidstat to give info every 5 seconds by default. Change-Id: I5ec7d5abce81125b55985bba3ccaf8073ccdfa2a --- stack.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stack.sh b/stack.sh index efdee64b34..1d02c16ff8 100755 --- a/stack.sh +++ b/stack.sh @@ -291,6 +291,9 @@ SYSLOG_PORT=${SYSLOG_PORT:-516} SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"} SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"} +PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"} +PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"} + # Use color for logging output (only available if syslog is not used) LOG_COLOR=`trueorfalse True $LOG_COLOR` @@ -874,6 +877,16 @@ if is_service_enabled sysstat; then fi fi +if is_service_enabled pidstat; then + # Per-process stats + PIDSTAT_OPTS="-l -p ALL -T ALL" + if [[ -n ${SCREEN_LOGDIR} ]]; then + screen_it pidstat "cd $TOP_DIR; pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL > $SCREEN_LOGDIR/$PIDSTAT_FILE" + else + screen_it pidstat "pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL" + fi +fi + # Start Services # ==============