summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-03-18 14:20:51 +0000
committerGerrit Code Review <review@openstack.org>2019-03-18 14:20:51 +0000
commitb844b96bffdeebd111e0bbd299c4b47882cc8f63 (patch)
tree8c85c1845403e6c2fc4f33960c763d0c4fcd8ed0
parenta195df7af8591ff63ae705418f0a07585a8391f1 (diff)
parentb4e8a72d29cab340fa68318045cf335267ff09ff (diff)
downloadosprofiler-b844b96bffdeebd111e0bbd299c4b47882cc8f63.tar.gz
Merge "Collect traces from Tempest job"
-rw-r--r--.zuul.yaml3
-rw-r--r--playbooks/osprofiler-post.yaml57
2 files changed, 59 insertions, 1 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index f4f58d0..53a49e4 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -26,12 +26,13 @@
name: tempest-full-py3-profiler-enabled
parent: tempest-full-py3
voting: false
+ post-run: playbooks/osprofiler-post.yaml
description: |
Run full tempest on py3 with profiling enabled
required-projects:
- openstack/osprofiler
vars:
- tox_envlist: full
+ tox_envlist: smoke
devstack_localrc:
OSPROFILER_COLLECTOR: redis
OSPROFILER_HMAC_KEYS: SECRET_KEY
diff --git a/playbooks/osprofiler-post.yaml b/playbooks/osprofiler-post.yaml
new file mode 100644
index 0000000..1455aad
--- /dev/null
+++ b/playbooks/osprofiler-post.yaml
@@ -0,0 +1,57 @@
+- hosts: controller
+ vars:
+ osprofiler_traces_dir: '/opt/stack/osprofiler-traces'
+ tasks:
+ - name: Create OSProfiler home directory
+ become: True
+ become_user: stack
+ file:
+ path: '{{ osprofiler_traces_dir }}'
+ state: directory
+ owner: stack
+ group: stack
+
+ - name: Get list of traces
+ command: osprofiler trace list --connection-string redis://localhost:6379
+ become: True
+ become_user: stack
+ register: osprofiler_trace_list
+
+ - debug:
+ msg: "{{ osprofiler_trace_list }}"
+
+ - name: Save traces to file
+ shell: |
+ osprofiler trace list --connection-string redis://localhost:6379 > {{ osprofiler_traces_dir }}/trace_list.txt
+ cat {{ osprofiler_traces_dir }}/trace_list.txt | tail -n +4 | head -n -1 | awk '{print $2}' > {{ osprofiler_traces_dir }}/trace_ids.txt
+
+ while read p; do
+ osprofiler trace show --connection-string redis://localhost:6379 --html $p > {{ osprofiler_traces_dir }}/trace-$p.html
+ done < {{ osprofiler_traces_dir }}/trace_ids.txt
+ become: True
+ become_user: stack
+
+ - name: Gzip results files
+ become: yes
+ become_user: stack
+ shell: "gzip * -9 -q | true"
+ args:
+ chdir: '{{ osprofiler_traces_dir }}'
+
+ - name: List all files
+ shell:
+ cmd: "ls -al {{ osprofiler_traces_dir }}"
+ become: True
+ become_user: stack
+
+ - name: Copy osprofiler output
+ become: yes
+ synchronize:
+ src: "{{ osprofiler_traces_dir }}"
+ dest: "{{ zuul.executor.log_root }}"
+ mode: pull
+ copy_links: true
+ verify_host: true
+ rsync_opts:
+ - "--include=/**"
+ - "--include=*/"