X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=testsuites%2Fposca%2Ftestcase_dashboard%2Fsystem_bandwidth.py;h=5479b670649760720f399e18ccd6a167ca006bcc;hb=refs%2Fchanges%2F67%2F59967%2F1;hp=e95ff21432f886c8200a52fcb1d8a7563ea25947;hpb=be6453bb485c720278c5f6a45a5194391e454ce4;p=bottlenecks.git diff --git a/testsuites/posca/testcase_dashboard/system_bandwidth.py b/testsuites/posca/testcase_dashboard/system_bandwidth.py index e95ff214..5479b670 100755 --- a/testsuites/posca/testcase_dashboard/system_bandwidth.py +++ b/testsuites/posca/testcase_dashboard/system_bandwidth.py @@ -17,9 +17,10 @@ from utils.parser import Parser as conf_parser LOG = log.Logger(__name__).getLogger() config = ConfigParser.ConfigParser() es = Elasticsearch() -dashboard_dir = os.path.join(conf_parser.test_dir, - "posca", - "testcase_dashboard") +dashboard_path = os.path.join(conf_parser.test_dir, + "posca", + "testcase_dashboard") +dashboard_dir = dashboard_path + "/" def dashboard_send_data(runner_config, test_data): @@ -30,7 +31,7 @@ def dashboard_send_data(runner_config, test_data): doc_type=test_data["testcase"], body=test_data["data_body"]) if res['created'] == "False": - LOG.error("date send to kibana have errors ", test_data["data_body"]) + LOG.error("date send to kibana have errors %s", test_data["data_body"]) def dashboard_system_bandwidth(runner_config): @@ -74,7 +75,6 @@ def dashboard_system_bandwidth(runner_config): else: LOG.info("system_bandwidth search has existed") - # Create testing data in line graph # Create testing data in line graph with open(dashboard_dir + 'posca_system_bandwidth_line_data.json')\ as line_data: @@ -103,6 +103,20 @@ def dashboard_system_bandwidth(runner_config): else: LOG.info("system_bandwidth_line-char visualization has existed") + # Create local cpu results in line chart + with open(dashboard_dir + 'posca_system_bandwidth_local_cpu.json')\ + as line_cpu: + doc = json.load(line_cpu) + res = es.index( + index=".kibana", + doc_type="visualization", + id="system_bandwidth_local_cpu", + body=doc) + if res['created'] == "True": + LOG.info("system_bandwidth_local_cpu visualization has created") + else: + LOG.info("system_bandwidth_local_cpu visualization has existed") + # Create monitoring data in table with open(dashboard_dir + 'posca_system_bandwidth_terms_data.json')\ as terms_char: