aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qtip/ansible_library/plugins/action/calculate.py7
-rw-r--r--resources/ansible_roles/qtip/tasks/calculate.yml11
2 files changed, 11 insertions, 7 deletions
diff --git a/qtip/ansible_library/plugins/action/calculate.py b/qtip/ansible_library/plugins/action/calculate.py
index ee3b8e3a..8d5fa1f7 100644
--- a/qtip/ansible_library/plugins/action/calculate.py
+++ b/qtip/ansible_library/plugins/action/calculate.py
@@ -10,6 +10,7 @@
##############################################################################
import humanfriendly
+import json
import numbers
from numpy import mean
import yaml
@@ -37,7 +38,11 @@ class ActionModule(ActionBase):
with open(self._task.args.get('spec')) as stream:
spec = yaml.safe_load(stream)
- metrics = self._task.args.get('metrics')
+ metrics_files = self._task.args.get('metrics')
+ metrics = {}
+ for metric, filename in metrics_files.items():
+ with open(filename) as f:
+ metrics[metric] = json.load(f)
dest = self._task.args.get('dest')
return calc_qpi(spec, metrics, dest=dest)
diff --git a/resources/ansible_roles/qtip/tasks/calculate.yml b/resources/ansible_roles/qtip/tasks/calculate.yml
index e4107e4d..62779c73 100644
--- a/resources/ansible_roles/qtip/tasks/calculate.yml
+++ b/resources/ansible_roles/qtip/tasks/calculate.yml
@@ -12,12 +12,11 @@
- name: calculate compute score
calculate:
metrics:
- ssl_rsa: "{{ ssl_rsa_metrics }}"
- ssl_aes: "{{ ssl_aes_metrics }}"
- dpi_throughput: "{{ dpi_metrics }}"
- intmem: "{{ intmem_metrics }}"
- floatmem: "{{ floatmem_metrics }}"
+ ssl_rsa: "{{ qtip_results }}/ssl/rsa-metrics.json"
+ ssl_aes: "{{ qtip_results }}/ssl/aes-metrics.json"
+ dpi_throughput: "{{ qtip_results }}/dpi/metrics.json"
+ intmem: "{{ qtip_results }}/memory/integer-metrics.json"
+ floatmem: "{{ qtip_results }}/memory/float-metrics.json"
spec: "{{ qtip_resources }}/QPI/compute.yaml"
dest: "{{ qtip_results }}/compute.json"
- register: qpi_result
delegate_to: localhost