-
Notifications
You must be signed in to change notification settings - Fork 0
/
extract_metrics.yml
46 lines (46 loc) · 1.33 KB
/
extract_metrics.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
---
- name: Extract metrics from prometheus
shell: "cd {{minecraft_tmp_dir.path}} && python extract_metrics.py {{start_time}} {{end_time}}"
- name: Fetch extracted statistics
fetch:
src: "{{minecraft_tmp_dir.path}}/metrics.json"
dest: "{{playbook_dir}}/metrics.json"
register: metrics_json_path
- name: "Move metrics"
copy:
src: "{{metrics_json_path.dest}}"
dest: "{{playbook_dir}}/results/{{timestamp}}/metrics.json"
register: metrics_final_path
- name: Remove fetch folder
file:
path: "{{playbook_dir}}/metrics.json/"
state: absent
- name: save info about node
shell: |
{
java -version;
free -g;
lscpu;
echo "{{JVM_config_parameters}}";
} > {{ playbook_dir }}/results/{{ timestamp }}/nodeinfo.log 2>&1
- name: Remove fetch folder
file:
path: "{{playbook_dir}}/metrics.json/"
state: absent
- name: Fetch server log(s)
fetch:
dest: "{{playbook_dir}}/logs"
src: "{{minecraft_tmp_dir.path}}/logs/latest.log"
register: logs_path
- name: Move logs
copy:
src: "{{logs_path.dest}}"
dest: "{{playbook_dir}}/results/{{timestamp}}/"
- name: move config file
copy:
src: "{{playbook_dir}}/experiment_configuration.yml"
dest: "{{playbook_dir}}/results/{{timestamp}}/"
- name: Remove fetch folder
file:
path: "{{playbook_dir}}/logs"
state: absent