diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-23 19:37:16 +0800 |
---|---|---|
committer | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-04-24 08:53:40 +0800 |
commit | 48d36caabb09f2456a1d7ad64acb7aa099277eda (patch) | |
tree | 748c4bd2a5d4c3e2f6fc76a77b358f8174d598ab /resources/ansible_roles/ramspeed/tasks | |
parent | e579659699b4571a69990efc5861914e4701a4f6 (diff) |
Save logs before collecting
Change-Id: I0e39103ef917fa7ea86d5c47de0cc71c37fca74c
Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/ramspeed/tasks')
-rw-r--r-- | resources/ansible_roles/ramspeed/tasks/main.yml | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/resources/ansible_roles/ramspeed/tasks/main.yml b/resources/ansible_roles/ramspeed/tasks/main.yml index 2ecf4279..bdb23b6c 100644 --- a/resources/ansible_roles/ramspeed/tasks/main.yml +++ b/resources/ansible_roles/ramspeed/tasks/main.yml @@ -11,14 +11,12 @@ file: path: "{{ workdir }}" state: directory - tags: [setup] - name: downloading ramsmp get_url: url: http://www.alasir.com/software/ramspeed/ramsmp-3.5.0.tar.gz dest: "{{ workdir }}" checksum: "sha256:39fb15493fb3c293575746d56f6ab9faaa1d876d8b1f0d8e5a4042d2ace95839" - tags: [setup] - name: extracting ramsmp # TODO(yujunz) unarchive may not work with long path (local: macOS, workdir: /root/qtip-workdir-20170423-0836/) @@ -32,51 +30,60 @@ args: chdir: "{{ workdir }}/ramsmp-3.5.0" creates: ramsmp - tags: [setup] - name: intmem benchmarking command: ./ramsmp -b 3 -l 5 -p 1 args: chdir: "{{ workdir }}/ramsmp-3.5.0" - register: ramsmp_intmem_out - tags: [run] + register: ramsmp_int_out - name: floatmem benchmarking command: ./ramsmp -b 6 -l 5 -p 1 args: chdir: "{{ workdir }}/ramsmp-3.5.0" - register: ramsmp_floatmem_out - tags: [run] + register: ramsmp_float_out + +- name: generating log filename + set_fact: + int_logfile: "{{ qtip_results }}/ramsmp-int.log" + float_logfile: "{{ qtip_results }}/ramsmp-float.log" + +- name: saving integer output to log + copy: + content: "{{ ramsmp_int_out.stdout }}" + dest: "{{ int_logfile }}" + delegate_to: localhost + +- name: saving floating point output to log + copy: + content: "{{ ramsmp_float_out.stdout }}" + dest: "{{ float_logfile }}" + delegate_to: localhost - name: collect integer memory metrics from ramspeed collect: - string: "{{ ramsmp_intmem_out.stdout }}" + string: "{{ lookup('file', int_logfile) }}" patterns: - '^INTEGER\s+BatchRun\s+Copy:\s+?(?P<copy>\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Scale:\s+?(?P<scale>\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Add:\s+?(?P<add>\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+Triad:\s+?(?P<triad>\d+\.\d+)\sMB/s$' - '^INTEGER\s+BatchRun\s+AVERAGE:\s+?(?P<average>\d+\.\d+)\sMB/s$' - dump: 'ramsmp-intmem.log' register: intmem_metrics - tags: [collect] - name: collect float memory metrics from ramspeed collect: - string: "{{ ramsmp_floatmem_out.stdout }}" + string: "{{ lookup('file', float_logfile) }}" patterns: - '^FL-POINT\s+BatchRun\s+Copy:\s+?(?P<copy>\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Scale:\s+?(?P<scale>\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Add:\s+?(?P<add>\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+Triad:\s+?(?P<triad>\d+\.\d+)\sMB/s$' - '^FL-POINT\s+BatchRun\s+AVERAGE:\s+?(?P<average>\d+\.\d+)\sMB/s$' - dump: 'ramsmp-floatmem.log' register: floatmem_metrics - tags: [collect] - name: create memory metrics report template: src: "memory-metrics.j2" dest: "{{ qtip_results }}/memory-metrics" delegate_to: localhost - tags: [report] |