summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py')
-rwxr-xr-xutils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py b/utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py
index 8d5326eb4..9a7e4ce1b 100755
--- a/utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py
+++ b/utils/test/result_collection_api/dashboard/bottlenecks2Dashboard.py
@@ -62,19 +62,35 @@ def format_rubbos_for_dashboard(results):
"""
test_data = [{'description': 'Rubbos results'}]
- # Graph 1:
+ # Graph 1:Rubbos maximal throughput
+ # ********************************
+ #new_element = []
+ #for each_result in results:
+ # throughput_data = [record['throughput'] for record in each_result['details']]
+ # new_element.append({'x': each_result['creation_date'],
+ # 'y': max(throughput_data)})
+
+ #test_data.append({'name': "Rubbos max throughput",
+ # 'info': {'type': "graph",
+ # 'xlabel': 'time',
+ # 'ylabel': 'maximal throughput'},
+ # 'data_set': new_element})
+
+ # Graph 2: Rubbos last record
# ********************************
new_element = []
- for each_result in results:
- throughput_data = [record['throughput'] for record in each_result['details']]
- new_element.append({'x': each_result['creation_date'],
- 'y': max(throughput_data)})
-
- test_data.append({'name': "Rubbos max throughput",
+ latest_result = results[-1]["details"]
+ for data in latest_result:
+ client_num = int(data["client"])
+ throughput = int(data["throughput"])
+ new_element.append({'x': client_num,
+ 'y': throughput})
+ test_data.append({'name': "Rubbos throughput vs client number",
'info': {'type': "graph",
- 'xlabel': 'time',
- 'ylabel': 'maximal throughput'},
+ 'xlabel': 'client number',
+ 'ylabel': 'throughput'},
'data_set': new_element})
+
return test_data
@@ -161,9 +177,9 @@ def _get_results(db_url, test_criteria):
myDataResults = myNewData['test_results']
return myDataResults
-
+#only for local test
def _test():
- db_url = "http://213.77.62.197"
+ db_url = "http://testresults.opnfv.org/testapi"
results = _get_results(db_url, {"project": "bottlenecks", "testcase": "rubbos"})
test_result = format_rubbos_for_dashboard(results)
print json.dumps(test_result, indent=4)