blob: 4b22752cedbebb868a69ad49748985eb29baf6f3 [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
16XTRACE=$(set +o | grep xtrace)
17set +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
Joe Gordon06005722015-01-13 16:36:43 +130022 DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv"
Ian Wienandc00d2a52015-04-09 19:57:13 +100023 run_process dstat "dstat $DSTAT_OPTS"
Joe Gordone0b08d02014-08-20 00:34:55 -070024}
25
26# stop_dstat() stop dstat process
27function stop_dstat {
Ian Wienandc00d2a52015-04-09 19:57:13 +100028 stop_process dstat
Joe Gordone0b08d02014-08-20 00:34:55 -070029}
30
31# Restore xtrace
32$XTRACE