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
diff --git a/files/apts/dstat b/files/apts/dstat
new file mode 100644
index 0000000..2b643b8
--- /dev/null
+++ b/files/apts/dstat
@@ -0,0 +1 @@
+dstat
diff --git a/files/rpms-suse/dstat b/files/rpms-suse/dstat
new file mode 100644
index 0000000..2b643b8
--- /dev/null
+++ b/files/rpms-suse/dstat
@@ -0,0 +1 @@
+dstat
diff --git a/files/rpms/dstat b/files/rpms/dstat
new file mode 100644
index 0000000..8a8f8fe
--- /dev/null
+++ b/files/rpms/dstat
@@ -0,0 +1 @@
+dstat
\ No newline at end of file
diff --git a/stack.sh b/stack.sh
index 303541d..1dfd4dd 100755
--- a/stack.sh
+++ b/stack.sh
@@ -298,6 +298,8 @@
SYSSTAT_FILE=${SYSSTAT_FILE:-"sysstat.dat"}
SYSSTAT_INTERVAL=${SYSSTAT_INTERVAL:-"1"}
+DSTAT_FILE=${DSTAT_FILE:-"dstat.txt"}
+
PIDSTAT_FILE=${PIDSTAT_FILE:-"pidstat.txt"}
PIDSTAT_INTERVAL=${PIDSTAT_INTERVAL:-"5"}
@@ -879,6 +881,16 @@
fi
fi
+if is_service_enabled dstat; then
+ # Per-process stats
+ DSTAT_OPTS="-tcndylp --top-cpu-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
+fi
+
if is_service_enabled pidstat; then
# Per-process stats
PIDSTAT_OPTS="-l -p ALL -T ALL"