devstack/lib/dstat
Sean Dague 5ae945244e run memory_tracker as root
In order to get memlocked pages this needs to be run as root, just
start it as root so that we don't have issues with the inability to
run sudo later in the run.

Change-Id: I7adab8cbb6d89d4717e427aec22e316d27bea075
2017-03-23 12:45:29 -04:00

44 lines
1.1 KiB
Bash

#!/bin/bash
#
# lib/dstat
# 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
_XTRACE_DSTAT=$(set +o | grep xtrace)
set +o xtrace
# start_dstat() - Start running processes, including screen
function start_dstat {
# A better kind of sysstat, with the top process per time slice
run_process dstat "$TOP_DIR/tools/dstat.sh $LOGDIR"
# To enable memory_tracker add:
# enable_service memory_tracker
# to your localrc
run_process memory_tracker "sudo $TOP_DIR/tools/memory_tracker.sh"
# 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"
run_process peakmem_tracker "sudo $TOP_DIR/tools/memory_tracker.sh"
fi
}
# stop_dstat() stop dstat process
function stop_dstat {
stop_process dstat
stop_process memory_tracker
}
# Restore xtrace
$_XTRACE_DSTAT