summaryrefslogtreecommitdiffstats
path: root/resources/roles/nDPI
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-20 22:51:59 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-04-21 13:43:50 +0800
commit6144eac326d14e26bbb849abea51c4cf7f3881b6 (patch)
tree15ab6fcd3eadfb6d9ae7d089b237a2f0416a9235 /resources/roles/nDPI
parent7273ca98a91399e188af15e192be93724977fe08 (diff)
Group test results and report under node
Change-Id: I66286787d06c5012c6dcf516cffb9f6fd76522c5 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
Diffstat (limited to 'resources/roles/nDPI')
-rw-r--r--resources/roles/nDPI/tasks/main.yml7
-rw-r--r--resources/roles/nDPI/templates/dpi-metrics.j24
2 files changed, 11 insertions, 0 deletions
diff --git a/resources/roles/nDPI/tasks/main.yml b/resources/roles/nDPI/tasks/main.yml
index b3e7259f..c53a22fc 100644
--- a/resources/roles/nDPI/tasks/main.yml
+++ b/resources/roles/nDPI/tasks/main.yml
@@ -58,3 +58,10 @@
- 'nDPI throughput:\s+?(?P<dpi_pps>\d+.\d+.*) \/ (?P<dpi_bps>\d+.\d+.*)$'
dump: 'nDPI.log'
register: dpi_metrics
+
+- name: create dpi report
+ template:
+ src: dpi-metrics.j2
+ dest: "{{ qtip_results }}/{{ inventory_hostname }}/dpi-metrics"
+ delegate_to: localhost
+ tags: [report]
diff --git a/resources/roles/nDPI/templates/dpi-metrics.j2 b/resources/roles/nDPI/templates/dpi-metrics.j2
new file mode 100644
index 00000000..4d6e0b69
--- /dev/null
+++ b/resources/roles/nDPI/templates/dpi-metrics.j2
@@ -0,0 +1,4 @@
+nDPI throughput
+===============
+
+{{ ('Result:', "{} / {}".format(dpi_metrics.dpi_pps[0], dpi_metrics.dpi_bps[0]))|justify }}