aboutsummaryrefslogtreecommitdiffstats
path: root/resources/ansible_roles/nDPI
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-23 19:37:16 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-24 08:53:40 +0800
commit48d36caabb09f2456a1d7ad64acb7aa099277eda (patch)
tree748c4bd2a5d4c3e2f6fc76a77b358f8174d598ab /resources/ansible_roles/nDPI
parente579659699b4571a69990efc5861914e4701a4f6 (diff)
Save logs before collecting
Change-Id: I0e39103ef917fa7ea86d5c47de0cc71c37fca74c Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/ansible_roles/nDPI')
-rw-r--r--resources/ansible_roles/nDPI/tasks/main.yml19
1 files changed, 14 insertions, 5 deletions
diff --git a/resources/ansible_roles/nDPI/tasks/main.yml b/resources/ansible_roles/nDPI/tasks/main.yml
index e8d359e5..230ee2e1 100644
--- a/resources/ansible_roles/nDPI/tasks/main.yml
+++ b/resources/ansible_roles/nDPI/tasks/main.yml
@@ -43,25 +43,34 @@
checksum: "sha256:ac5d1501d91a6d8a8d3bfcef6f74a87bf660cd2c2ab11b9791535aa5193e4f71"
validate_certs: no # required when using proxy for https
-- name:
+- name: measuring dpi performance
command: "./ndpiReader -i {{ sample_pcap }}"
args:
chdir: "{{ workdir }}/nDPI-1.6/example/"
register: ndpi_out
-- name: collect DPI metrics from nDPI
+- name: generating log filename
+ set_fact:
+ logfile: "{{ qtip_results }}/nDPI.log"
+
+- name: saving output to log
+ copy:
+ content: "{{ ndpi_out.stdout }}"
+ dest: "{{ logfile }}"
+ delegate_to: localhost
+
+- name: collecting DPI metrics
collect:
- string: "{{ ndpi_out.stdout }}"
+ string: "{{ lookup('file', logfile) }}"
patterns:
# nDPI throughput: 1.46 M pps / 13.69 Gb/sec
# TODO(yujunz) convert "M pps" and "K pps" to number
- 'nDPI throughput:\s+?(?P<dpi_pps>\d+.\d+.*) \/ (?P<dpi_bps>\d+.\d+.*)$'
- dump: 'nDPI.log'
register: dpi_metrics
+ delegate_to: localhost
- name: create dpi report
template:
src: dpi-metrics.j2
dest: "{{ qtip_results }}/dpi-metrics"
delegate_to: localhost
- tags: [report]