2014-12-05 14:25:28 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2014-11-18 12:30:16 +09:00
|
|
|
# lib/dstat
|
2014-08-20 00:34:55 -07:00
|
|
|
# Functions to start and stop dstat
|
|
|
|
|
|
|
|
# Dependencies:
|
|
|
|
#
|
|
|
|
# - ``functions`` file
|
|
|
|
|
|
|
|
# ``stack.sh`` calls the entry points in this order:
|
|
|
|
#
|
|
|
|
# - start_dstat
|
|
|
|
# - stop_dstat
|
|
|
|
|
|
|
|
# Save trace setting
|
2015-10-13 11:03:03 +11:00
|
|
|
_XTRACE_DSTAT=$(set +o | grep xtrace)
|
2014-08-20 00:34:55 -07:00
|
|
|
set +o xtrace
|
|
|
|
|
2017-08-30 14:16:58 -04:00
|
|
|
# start_dstat() - Start running processes
|
2014-08-20 00:34:55 -07:00
|
|
|
function start_dstat {
|
|
|
|
# A better kind of sysstat, with the top process per time slice
|
2015-08-05 10:25:00 -06:00
|
|
|
run_process dstat "$TOP_DIR/tools/dstat.sh $LOGDIR"
|
2015-04-09 13:51:23 +10:00
|
|
|
|
2017-02-10 06:17:37 +00:00
|
|
|
# To enable memory_tracker add:
|
|
|
|
# enable_service memory_tracker
|
2015-04-09 13:51:23 +10:00
|
|
|
# to your localrc
|
2017-03-21 20:50:24 -04:00
|
|
|
run_process memory_tracker "$TOP_DIR/tools/memory_tracker.sh" "" "root"
|
2017-02-10 06:17:37 +00:00
|
|
|
|
|
|
|
# remove support for the old name when it's no longer used (sometime in Queens)
|
|
|
|
if is_service_enabled peakmem_tracker; then
|
|
|
|
deprecated "Use of peakmem_tracker in devstack is deprecated, use memory_tracker instead"
|
2017-03-21 20:50:24 -04:00
|
|
|
run_process peakmem_tracker "$TOP_DIR/tools/memory_tracker.sh" "" "root"
|
2017-02-10 06:17:37 +00:00
|
|
|
fi
|
2014-08-20 00:34:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# stop_dstat() stop dstat process
|
|
|
|
function stop_dstat {
|
2015-04-09 19:57:13 +10:00
|
|
|
stop_process dstat
|
2017-02-10 06:17:37 +00:00
|
|
|
stop_process memory_tracker
|
2014-08-20 00:34:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# Restore xtrace
|
2015-10-13 11:03:03 +11:00
|
|
|
$_XTRACE_DSTAT
|