Browse code

run dstat with run_process

It is not clear to me why this can't use run_process? Currently we
end up with two log-files both with the same thing

- dstat.txt.gz which comes from the "tee" and is symlinked into
SCREEN_LOGDIR, so gets picked-up by the gate scripts
- screen-dstat.txt.gz which comes from screen_it

Change-Id: I00b9e09b8d44f72ff14e69dc6e4a4bd5e2a0439e

Ian Wienand authored on 2015/04/09 18:57:13
Showing 1 changed files
... ...
@@ -16,34 +16,16 @@
16 16
 XTRACE=$(set +o | grep xtrace)
17 17
 set +o xtrace
18 18
 
19
-
20
-# Defaults
21
-# --------
22
-# for DSTAT logging
23
-DSTAT_FILE=${DSTAT_FILE:-"dstat.log"}
24
-
25
-
26 19
 # start_dstat() - Start running processes, including screen
27 20
 function start_dstat {
28 21
     # A better kind of sysstat, with the top process per time slice
29 22
     DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
30
-    if [[ -n ${LOGDIR} ]]; then
31
-        screen_it dstat "cd $TOP_DIR; dstat $DSTAT_OPTS | tee $LOGDIR/$DSTAT_FILE"
32
-        if [[ -n ${SCREEN_LOGDIR} && ${SCREEN_LOGDIR} != ${LOGDIR} ]]; then
33
-            # Drop the backward-compat symlink
34
-            ln -sf $LOGDIR/$DSTAT_FILE ${SCREEN_LOGDIR}/$DSTAT_FILE
35
-        fi
36
-    else
37
-        screen_it dstat "dstat $DSTAT_OPTS"
38
-    fi
23
+    run_process dstat "dstat $DSTAT_OPTS"
39 24
 }
40 25
 
41 26
 # stop_dstat() stop dstat process
42 27
 function stop_dstat {
43
-    # dstat runs as a console, not as a service, and isn't trackable
44
-    # via the normal mechanisms for DevStack. So lets just do a
45
-    # killall and move on.
46
-    killall dstat || /bin/true
28
+    stop_process dstat
47 29
 }
48 30
 
49 31
 # Restore xtrace