blob: 62795f5e723ae4b3fe93e87453de6eb9d54831d9 [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
YAMAMOTO Takashi42373c72014-11-18 12:30:16 +09003# lib/dstat
Joe Gordone0b08d02014-08-20 00:34:55 -07004# Functions to start and stop dstat
5
6# Dependencies:
7#
8# - ``functions`` file
9
10# ``stack.sh`` calls the entry points in this order:
11#
12# - start_dstat
13# - stop_dstat
14
15# Save trace setting
Ian Wienand523f4882015-10-13 11:03:03 +110016_XTRACE_DSTAT=$(set +o | grep xtrace)
Joe Gordone0b08d02014-08-20 00:34:55 -070017set +o xtrace
18
Joe Gordone0b08d02014-08-20 00:34:55 -070019# start_dstat() - Start running processes, including screen
20function start_dstat {
21 # A better kind of sysstat, with the top process per time slice
Tim Buckleya83e90b2015-08-05 10:25:00 -060022 run_process dstat "$TOP_DIR/tools/dstat.sh $LOGDIR"
Ian Wienand72a8be62015-04-09 13:51:23 +100023
Ihar Hrachyshka2b4735f2017-02-10 06:17:37 +000024 # To enable memory_tracker add:
25 # enable_service memory_tracker
Ian Wienand72a8be62015-04-09 13:51:23 +100026 # to your localrc
Ihar Hrachyshka2b4735f2017-02-10 06:17:37 +000027 run_process memory_tracker "$TOP_DIR/tools/memory_tracker.sh"
28
29 # remove support for the old name when it's no longer used (sometime in Queens)
30 if is_service_enabled peakmem_tracker; then
31 deprecated "Use of peakmem_tracker in devstack is deprecated, use memory_tracker instead"
32 run_process peakmem_tracker "$TOP_DIR/tools/memory_tracker.sh"
33 fi
Joe Gordone0b08d02014-08-20 00:34:55 -070034}
35
36# stop_dstat() stop dstat process
37function stop_dstat {
Ian Wienandc00d2a52015-04-09 19:57:13 +100038 stop_process dstat
Ihar Hrachyshka2b4735f2017-02-10 06:17:37 +000039 stop_process memory_tracker
Joe Gordone0b08d02014-08-20 00:34:55 -070040}
41
42# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110043$_XTRACE_DSTAT