Browse code

add dstat to see top process info

pidstat data isn't exceptionally useful, it's lots of lines, and
seems to be missing some of the most critical one.

dstat is kind of like sysstat, except the formatting is much better.
It also supports advanced features like the top CPU using process
at every interval.

put this behind the sysstat variable, as we'll probably want to
replace sysstat & pidstat with this if it works

Change-Id: I48dc22a0a7e63fe3abb527646cc70525998a7d85

Sean Dague authored on 2014/02/11 12:24:49
Showing 4 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+dstat
0 1
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+dstat
0 1
new file mode 100644
... ...
@@ -0,0 +1 @@
0
+dstat
0 1
\ No newline at end of file
... ...
@@ -298,6 +298,8 @@ SYSLOG_PORT=${SYSLOG_PORT:-516}
298 298
 SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
299 299
 SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
300 300
 
301
+DSTAT_FILE=${DSTAT_FILE:-"dstat.txt"}
302
+
301 303
 PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"}
302 304
 PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"}
303 305
 
... ...
@@ -879,6 +881,16 @@ if is_service_enabled sysstat; then
879 879
     fi
880 880
 fi
881 881
 
882
+if is_service_enabled dstat; then
883
+    # Per-process stats
884
+    DSTAT_OPTS="-tcndylp --top-cpu-adv"
885
+    if [[ -n ${SCREEN_LOGDIR} ]]; then
886
+        screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $SCREEN_LOGDIR/$DSTAT_FILE"
887
+    else
888
+        screen_it dstat "dstat $DSTAT_OPTS"
889
+    fi
890
+fi
891
+
882 892
 if is_service_enabled pidstat; then
883 893
     # Per-process stats
884 894
     PIDSTAT_OPTS="-l -p ALL -T ALL"