Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
YAMAMOTO Takashi | 42373c7 | 2014-11-18 12:30:16 +0900 | [diff] [blame] | 3 | # lib/dstat |
Joe Gordon | e0b08d0 | 2014-08-20 00:34:55 -0700 | [diff] [blame] | 4 | # 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 |
| 16 | XTRACE=$(set +o | grep xtrace) |
| 17 | set +o xtrace |
| 18 | |
Joe Gordon | e0b08d0 | 2014-08-20 00:34:55 -0700 | [diff] [blame] | 19 | # start_dstat() - Start running processes, including screen |
| 20 | function start_dstat { |
| 21 | # A better kind of sysstat, with the top process per time slice |
Joe Gordon | 0600572 | 2015-01-13 16:36:43 +1300 | [diff] [blame] | 22 | DSTAT_OPTS="-tcmndrylpg --top-cpu-adv --top-io-adv" |
Ian Wienand | c00d2a5 | 2015-04-09 19:57:13 +1000 | [diff] [blame^] | 23 | run_process dstat "dstat $DSTAT_OPTS" |
Joe Gordon | e0b08d0 | 2014-08-20 00:34:55 -0700 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | # stop_dstat() stop dstat process |
| 27 | function stop_dstat { |
Ian Wienand | c00d2a5 | 2015-04-09 19:57:13 +1000 | [diff] [blame^] | 28 | stop_process dstat |
Joe Gordon | e0b08d0 | 2014-08-20 00:34:55 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | # Restore xtrace |
| 32 | $XTRACE |