From b140bd0f8055af4f1624a2c9a6291f7923003122 Mon Sep 17 00:00:00 2001 From: Morgan Richomme Date: Wed, 25 May 2016 15:32:54 +0200 Subject: Test API add start_date, stop_date parameters in results Change-Id: I8c8c5b1d82e447fb7a7413368a919b3d3c7b99a6 Signed-off-by: Morgan Richomme --- .../dashboard/bottlenecks2Dashboard.py | 2 +- .../dashboard/doctor2Dashboard.py | 2 +- .../dashboard/functest2Dashboard.py | 28 +++++++++++----------- result_collection_api/dashboard/qtip2Dashboard.py | 2 +- .../dashboard/vsperf2Dashboard.py | 6 ++--- .../dashboard/yardstick2Dashboard.py | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) (limited to 'result_collection_api/dashboard') diff --git a/result_collection_api/dashboard/bottlenecks2Dashboard.py b/result_collection_api/dashboard/bottlenecks2Dashboard.py index 9a7e4ce..2e106be 100755 --- a/result_collection_api/dashboard/bottlenecks2Dashboard.py +++ b/result_collection_api/dashboard/bottlenecks2Dashboard.py @@ -67,7 +67,7 @@ def format_rubbos_for_dashboard(results): #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'], + # new_element.append({'x': each_result['start_date'], # 'y': max(throughput_data)}) #test_data.append({'name': "Rubbos max throughput", diff --git a/result_collection_api/dashboard/doctor2Dashboard.py b/result_collection_api/dashboard/doctor2Dashboard.py index eba35b5..38b23ab 100644 --- a/result_collection_api/dashboard/doctor2Dashboard.py +++ b/result_collection_api/dashboard/doctor2Dashboard.py @@ -78,7 +78,7 @@ def format_doctor_notification_case_for_dashboard(results): # consider only seconds => 09 for data in results: t = data['details']['duration'] - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': t}) test_data.append({'name': "doctor-notification duration ", diff --git a/result_collection_api/dashboard/functest2Dashboard.py b/result_collection_api/dashboard/functest2Dashboard.py index 379b932..86521b9 100644 --- a/result_collection_api/dashboard/functest2Dashboard.py +++ b/result_collection_api/dashboard/functest2Dashboard.py @@ -89,7 +89,7 @@ def format_vIMS_for_dashboard(results): new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': data['details']['orchestrator']['duration'], 'y2': data['details']['vIMS']['duration'], 'y3': data['details']['sig_test']['duration']}) @@ -127,7 +127,7 @@ def format_vIMS_for_dashboard(results): except: nbTests = 0 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': nbTests, 'y2': nbFailures, 'y3': nbSkipped}) @@ -181,7 +181,7 @@ def format_Tempest_for_dashboard(results): # ******************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': data['details']['duration']}) test_data.append({'name': "Tempest duration", @@ -194,7 +194,7 @@ def format_Tempest_for_dashboard(results): # *************************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': data['details']['tests'], 'y2': data['details']['failures']}) @@ -229,7 +229,7 @@ def format_Tempest_for_dashboard(results): except: success_rate = 0 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': success_rate}) test_data.append({'name': "Tempest success rate", @@ -257,7 +257,7 @@ def format_ODL_for_dashboard(results): for odl in odl_results: if (odl['test_status']['@status'] == "FAIL"): nbFailures += 1 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': len(odl_results), 'y2': nbFailures}) @@ -288,7 +288,7 @@ def format_ONOS_for_dashboard(results): new_duration = int(datetime.timedelta(hours=int(h), minutes=int(m), seconds=int(s)).total_seconds()) - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': new_duration}) test_data.append({'name': "ONOS FUNCvirNet duration ", @@ -307,7 +307,7 @@ def format_ONOS_for_dashboard(results): for onos in onos_results: if (onos['Case result'] == "FAIL"): nbFailures += 1 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': len(onos_results), 'y2': nbFailures}) @@ -331,7 +331,7 @@ def format_ONOS_for_dashboard(results): new_duration = int(datetime.timedelta(hours=int(h), minutes=int(m), seconds=int(s)).total_seconds()) - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': new_duration}) test_data.append({'name': "ONOS FUNCvirNetL3 duration", @@ -350,7 +350,7 @@ def format_ONOS_for_dashboard(results): for onos in onos_results: if (onos['Case result'] == "FAIL"): nbFailures += 1 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': len(onos_results), 'y2': nbFailures}) @@ -373,7 +373,7 @@ def format_Rally_for_dashboard(results): new_element = [] for data in results: summary_cursor = len(data['details']) - 1 - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': int(data['details'][summary_cursor]['summary']['duration'])}) test_data.append({'name': "rally duration", @@ -386,7 +386,7 @@ def format_Rally_for_dashboard(results): # ******************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': float(data['details'][summary_cursor]['summary']['nb success'])}) test_data.append({'name': "rally success rate", @@ -408,7 +408,7 @@ def format_vPing_for_dashboard(results): # ******************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': data['details']['duration']}) test_data.append({'name': "vPing duration", @@ -445,7 +445,7 @@ def format_vPing_userdata_for_dashboard(results): # ******************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': data['details']['duration']}) test_data.append({'name': "vPing_userdata duration", diff --git a/result_collection_api/dashboard/qtip2Dashboard.py b/result_collection_api/dashboard/qtip2Dashboard.py index 0112945..6ceccd3 100644 --- a/result_collection_api/dashboard/qtip2Dashboard.py +++ b/result_collection_api/dashboard/qtip2Dashboard.py @@ -93,7 +93,7 @@ def _get_results(db_url, testcase): rawresults = datajson['test_results'][x]['details'] index = rawresults['index'] - resultarray[str(datajson['test_results'][x]['creation_date'])]=index + resultarray[str(datajson['test_results'][x]['start_date'])]=index return resultarray diff --git a/result_collection_api/dashboard/vsperf2Dashboard.py b/result_collection_api/dashboard/vsperf2Dashboard.py index 323d391..5a6882d 100755 --- a/result_collection_api/dashboard/vsperf2Dashboard.py +++ b/result_collection_api/dashboard/vsperf2Dashboard.py @@ -79,7 +79,7 @@ def format_common_for_dashboard(case, results): # ******************************** new_element = [] for data in results: - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y1': data['details']['64'], 'y2': data['details']['128'], 'y3': data['details']['512'], @@ -105,8 +105,8 @@ def format_common_for_dashboard(case, results): import os def _test(): - ans = [{'creation_date': '2015-09-12', 'project_name': 'vsperf', 'version': 'ovs_master', 'pod_name': 'pod1-vsperf', 'case_name': 'tput_ovsdpdk', 'installer': 'build_sie', 'details': {'64': '26.804', '1024': '1097.284', '512': '178.137', '1518': '12635.860', '128': '100.564'}}, - {'creation_date': '2015-09-33', 'project_name': 'vsperf', 'version': 'ovs_master', 'pod_name': 'pod1-vsperf', 'case_name': 'tput_ovsdpdk', 'installer': 'build_sie', 'details': {'64': '16.804', '1024': '1087.284', '512': '168.137', '1518': '12625.860', '128': '99.564'}}] + ans = [{'start_date': '2015-09-12', 'project_name': 'vsperf', 'version': 'ovs_master', 'pod_name': 'pod1-vsperf', 'case_name': 'tput_ovsdpdk', 'installer': 'build_sie', 'details': {'64': '26.804', '1024': '1097.284', '512': '178.137', '1518': '12635.860', '128': '100.564'}}, + {'start_date': '2015-09-33', 'project_name': 'vsperf', 'version': 'ovs_master', 'pod_name': 'pod1-vsperf', 'case_name': 'tput_ovsdpdk', 'installer': 'build_sie', 'details': {'64': '16.804', '1024': '1087.284', '512': '168.137', '1518': '12625.860', '128': '99.564'}}] result = format_vsperf_for_dashboard("pvp_cont_ovsdpdkcuse", ans) print result diff --git a/result_collection_api/dashboard/yardstick2Dashboard.py b/result_collection_api/dashboard/yardstick2Dashboard.py index 20b0864..4f022d5 100644 --- a/result_collection_api/dashboard/yardstick2Dashboard.py +++ b/result_collection_api/dashboard/yardstick2Dashboard.py @@ -84,7 +84,7 @@ def format_Ping_for_dashboard(results): if "benchmark" in record] avg_rtt = sum(records) / len(records) - new_element.append({'x': data['creation_date'], + new_element.append({'x': data['start_date'], 'y': avg_rtt}) test_data.append({'name': "ping duration", -- cgit 1.2.3-korg