Browse code

Merge "Add pidstat support"

Jenkins authored on 2014/01/26 06:06:14
Showing 1 changed files
... ...
@@ -298,6 +298,9 @@ SYSLOG_PORT=${SYSLOG_PORT:-516}
298 298
 SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
299 299
 SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
300 300
 
301
+PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"}
302
+PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"}
303
+
301 304
 # Use color for logging output (only available if syslog is not used)
302 305
 LOG_COLOR=`trueorfalse True $LOG_COLOR`
303 306
 
... ...
@@ -885,6 +888,16 @@ if is_service_enabled sysstat; then
885 885
     fi
886 886
 fi
887 887
 
888
+if is_service_enabled pidstat; then
889
+    # Per-process stats
890
+    PIDSTAT_OPTS="-l -p ALL -T ALL"
891
+    if [[ -n ${SCREEN_LOGDIR} ]]; then
892
+        screen_it pidstat "cd $TOP_DIR; pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL > $SCREEN_LOGDIR/$PIDSTAT_FILE"
893
+    else
894
+        screen_it pidstat "pidstat $PIDSTAT_OPTS $PIDSTAT_INTERVAL"
895
+    fi
896
+fi
897
+
888 898
 
889 899
 # Start Services
890 900
 # ==============