diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2016-10-12 00:49:41 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2016-10-12 00:49:41 +0000 |
commit | d9ab655653e2d343a8eac7560c50c6bed632a09f (patch) | |
tree | 5abb194dad3bacfb3d5ee3fe8c6f79735b654305 | |
parent | 9955bf7bbdd2f9a51f710d1a129daf99e6b10cda (diff) | |
parent | 7b460351f5eed62696c174191e6a1c3d095fe574 (diff) |
Merge "visualize qpi using kibana_dashboard"
5 files changed, 99 insertions, 2 deletions
diff --git a/utils/test/dashboard/dashboard/elastic2kibana/templates/qpi.json b/utils/test/dashboard/dashboard/elastic2kibana/templates/qpi.json new file mode 100644 index 000000000..a46f315ef --- /dev/null +++ b/utils/test/dashboard/dashboard/elastic2kibana/templates/qpi.json @@ -0,0 +1,45 @@ +{% set aggs = aggs|default([]) -%} + +{ + "title": "qpi", + "type": "line", + "listeners": {}, + "params": { + "addLegend": true, + "shareYAxis": true, + "addTooltip": true, + "smoothLines": false, + "scale": "linear", + "interpolate": "linear", + "times": [], + "addTimeMarker": false, + "defaultYExtents": false, + "setYExtents": false, + "yAxis": {}, + "mode": "stacked" + }, + "aggs": [ + {% for agg in aggs %} + { + "id": {{agg.id }}, + "type": "avg", + "schema": "metric", + "params": { + "field": "{{agg.field}}" + } + }, + {% endfor %} + { + "id": {{ aggs|length + 1 }}, + "type": "date_histogram", + "schema": "segment", + "params": { + "field": "start_date", + "interval": "auto", + "customInterval": "2h", + "min_doc_count": 1, + "extended_bounds": {} + } + } + ] +} diff --git a/utils/test/dashboard/dashboard/mongo2elastic/format.py b/utils/test/dashboard/dashboard/mongo2elastic/format.py index ef485bae0..0bbde1746 100644 --- a/utils/test/dashboard/dashboard/mongo2elastic/format.py +++ b/utils/test/dashboard/dashboard/mongo2elastic/format.py @@ -184,3 +184,21 @@ def format_vims(testcase): } } return True + + +def format_qpi(testcase): + """ + Look for these and leave any of those: + details.index + + If none are present, then return False + """ + details = testcase['details'] + if 'index' not in details: + return False + + for key, value in details.items(): + if key != 'index': + del details[key] + + return True diff --git a/utils/test/dashboard/dashboard/mongo2elastic/main.py b/utils/test/dashboard/dashboard/mongo2elastic/main.py index a526d5319..303d82c6f 100644 --- a/utils/test/dashboard/dashboard/mongo2elastic/main.py +++ b/utils/test/dashboard/dashboard/mongo2elastic/main.py @@ -91,10 +91,16 @@ class DocumentVerification(object): return self.skip def _fix_date(self, date_string): + if date_string == 'None': + return None if isinstance(date_string, dict): return date_string['$date'] - else: - return date_string[:-3].replace(' ', 'T') + 'Z' + if 'T' not in date_string: + date_string = date_string[:-3].replace(' ', 'T') + if not date_string.endswith('Z'): + date_string += 'Z' + + return date_string class DocumentPublisher(object): diff --git a/utils/test/dashboard/dashboard/qtip/__init__.py b/utils/test/dashboard/dashboard/qtip/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/utils/test/dashboard/dashboard/qtip/__init__.py diff --git a/utils/test/dashboard/dashboard/qtip/testcases.yaml b/utils/test/dashboard/dashboard/qtip/testcases.yaml new file mode 100644 index 000000000..cd337cd73 --- /dev/null +++ b/utils/test/dashboard/dashboard/qtip/testcases.yaml @@ -0,0 +1,28 @@ +qtip: + - + name: compute_test_suite + format: qpi + test_family: compute + visualizations: + - + name: qpi + fields: + - field: details.index + - + name: network_test_suite + test_family: network + format: qpi + visualizations: + - + name: qpi + fields: + - field: details.index + - + name:storage_test_suite + format: qpi + test_family: storage + visualizations: + - + name: qpi + fields: + - field: details.index |