From 062cdaf84c11fbbef71cab1db833c4aac3baadbf Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Mon, 10 Feb 2014 22:24:49 -0500 Subject: [PATCH] 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 --- files/apts/dstat | 1 + files/rpms-suse/dstat | 1 + files/rpms/dstat | 1 + stack.sh | 12 ++++++++++++ 4 files changed, 15 insertions(+) create mode 100644 files/apts/dstat create mode 100644 files/rpms-suse/dstat create mode 100644 files/rpms/dstat diff --git a/files/apts/dstat b/files/apts/dstat new file mode 100644 index 0000000000..2b643b8b1b --- /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 0000000000..2b643b8b1b --- /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 0000000000..8a8f8fe737 --- /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 303541d63e..1dfd4ddbc6 100755 --- a/stack.sh +++ b/stack.sh @@ -298,6 +298,8 @@ SYSLOG_PORT=${SYSLOG_PORT:-516} 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 @@ if is_service_enabled sysstat; then 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"