summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/dashboard/functest2Dashboard.py
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-02-11 16:09:08 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-02-11 16:09:08 +0000
commitc75e40ceaf26451384024d9917b931350238e49d (patch)
tree4feeb2fc3c0c4bb7dff785d133481b9274e84d81 /utils/test/result_collection_api/dashboard/functest2Dashboard.py
parent991431d19f3ea368eaf21cc3e069b492c9c475ff (diff)
parent3b58a9cefb543d1a6ef8404dbe6690b53748a32f (diff)
Merge "Add Rally summary and Doctor for visualization"
Diffstat (limited to 'utils/test/result_collection_api/dashboard/functest2Dashboard.py')
-rw-r--r--utils/test/result_collection_api/dashboard/functest2Dashboard.py30
1 files changed, 28 insertions, 2 deletions
diff --git a/utils/test/result_collection_api/dashboard/functest2Dashboard.py b/utils/test/result_collection_api/dashboard/functest2Dashboard.py
index a817f7597..3f4e1a2db 100644
--- a/utils/test/result_collection_api/dashboard/functest2Dashboard.py
+++ b/utils/test/result_collection_api/dashboard/functest2Dashboard.py
@@ -14,8 +14,8 @@
# a new method format_<Test_case>_for_dashboard(results)
# v0.1: basic example with methods for odl, Tempest, Rally and vPing
#
-import re
import datetime
+import re
def get_functest_cases():
@@ -343,6 +343,33 @@ def format_Rally_for_dashboard(results):
Post processing for the Rally test case
"""
test_data = [{'description': 'Rally results for Dashboard'}]
+ # Graph 1: Test_Duration = f(time)
+ # ********************************
+ new_element = []
+ for data in results:
+ summary_cursor = len(data)
+ new_element.append({'x': data['creation_date'],
+ 'y': int(data['details'][summary_cursor]['summary']['duration'])})
+
+ test_data.append({'name': "rally duration",
+ 'info': {'type': "graph",
+ 'xlabel': 'time',
+ 'ylabel': 'duration (s)'},
+ 'data_set': new_element})
+
+ # Graph 2: Success rate = f(time)
+ # ********************************
+ new_element = []
+ for data in results:
+ new_element.append({'x': data['creation_date'],
+ 'y': float(data['details'][summary_cursor]['summary']['nb success'])})
+
+ test_data.append({'name': "rally success rate",
+ 'info': {'type': "graph",
+ 'xlabel': 'time',
+ 'ylabel': 'success rate (%)'},
+ 'data_set': new_element})
+
return test_data
@@ -418,4 +445,3 @@ def format_vPing_userdata_for_dashboard(results):
'Nb Success': nbTestOk}]})
return test_data
-