-
Notifications
You must be signed in to change notification settings - Fork 7
/
start.yml
49 lines (45 loc) · 1.31 KB
/
start.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: Capture dstat version
shell: "dstat --version | head -n 1"
register: dstat_version
- name: Fail if dstat is not the correct version
fail:
msg: "Only Dstat 0.7.2 is allowed, you have {{ dstat_version }} installed"
when: dstat_version.stdout != "Dstat 0.7.2"
- name: Remove previous /tmp/dstat.csv
file:
path: /tmp/dstat.csv
state: absent
# This is necessary to clear disk caches, etc. This way the disk read
# and write statistics are consistent across test runs.
- name: Drop caches to reset state
shell: echo 3 | sudo tee /proc/sys/vm/drop_caches
# We use dstat to periodically (every 1s) capture snapshots of system statistics.
# We output these snapshots to CSV for posterity.
#
# WARNING! - Do NOT change the options unless you are certain the CSV file is
# backwards compatible. Changing the structure of this file makes it
# very difficult to compare results across time with tools like Athena.
- name: Start dstat profiling
command:
argv: [
"dstat",
"--epoch",
"--cpu",
"--disk",
"--io",
"--load",
"--mem",
"--net",
"--proc",
"--proc-count",
"--sys",
"--socket",
"--tcp",
"--udp",
"--vm",
"--output", "/tmp/dstat.csv",
]
async: 1000
poll: 0
register: dstat