summaryrefslogtreecommitdiffstats
path: root/utils/test
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-11 15:41:45 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-10-11 20:00:23 +0800
commit7b460351f5eed62696c174191e6a1c3d095fe574 (patch)
tree94de06d3d18a431fb665456c740e4a9dba774466 /utils/test
parent305b6650d3ed35dd0d15bb26243663f6fd759aa8 (diff)
visualize qpi using kibana_dashboard
JIRA: QTIP-122 Change-Id: Ice29c0a841e911b23959c91322331c5a66281be5 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test')
-rw-r--r--utils/test/dashboard/dashboard/elastic2kibana/templates/qpi.json45
-rw-r--r--utils/test/dashboard/dashboard/mongo2elastic/format.py18
-rw-r--r--utils/test/dashboard/dashboard/mongo2elastic/main.py10
-rw-r--r--utils/test/dashboard/dashboard/qtip/__init__.py0
-rw-r--r--utils/test/dashboard/dashboard/qtip/testcases.yaml28
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