Fix dashboard data generate 19/76119/9
authorLuis Gomez <ecelgp@gmail.com>
Sun, 16 Sep 2018 20:21:01 +0000 (13:21 -0700)
committerLuis Gomez <ecelgp@gmail.com>
Mon, 17 Sep 2018 23:29:21 +0000 (23:29 +0000)
Change-Id: I8a40dcbf8c87afd5e964dbe2790fc13751a5ab16
Signed-off-by: Luis Gomez <ecelgp@gmail.com>
csit/scripts/data_generate.py
csit/scripts/push_to_elk.py
dashboard/dash_config.yaml
dashboard/viz_config.yaml

index 9a7f714aae2b9ea7785124375ad130c67b9546fe..b0725210888f6d88d1dec40f3a898e3f5a70ed36 100644 (file)
@@ -34,9 +34,8 @@ def generate():
                 lines = file.readlines()
             props = lines[0].strip().split(',')
             vals = lines[1].strip().split(',')
-            BODY['plots'][key][props[0]] = float(vals[0])
-            BODY['plots'][key][props[1]] = float(vals[1])
-            BODY['plots'][key][props[2]] = float(vals[2])
+            for i in range(len(props)):
+                BODY['plots'][key][props[i]] = float(vals[i])
 
     # Fill the required parameters whose values are obtained from environment.
 
@@ -61,9 +60,4 @@ def generate():
         - datetime.strptime(starttime, '%Y%m%d %H:%M:%S.%f')
     BODY['duration'] = str(elap_time)
 
-    BODY = {
-        'type': BODY['test-type'],
-        BODY['test-type']: BODY
-    }
-
     return BODY
index 4bbc270c638fbd26833c7d6df62aebef0c02f237..f08b888345c1b912e644d3fea19a004789d94d6b 100755 (executable)
@@ -105,10 +105,10 @@ print(json.dumps(BODY, indent=4))
 # Try to send request to ELK DB.
 
 try:
-    index = '{}-{}'.format(BODY[BODY['type']]['project'],
-                           BODY[BODY['type']]['subject'])
-    ES_ID = '{}:{}-{}'.format(BODY['type'], BODY[BODY['type']]
-                              ['test-name'], BODY[BODY['type']]['test-run'])
+    index = '{}-{}'.format(BODY['project'],
+                           BODY['subject'])
+    ES_ID = '{}:{}-{}'.format(BODY['test-type'], BODY['test-name'],
+                              BODY['test-run'])
     res = es.index(index=index, doc_type='doc', id=ES_ID, body=BODY)
     print(json.dumps(res, indent=4))
 except Exception as e:
@@ -137,16 +137,16 @@ def JSONToString(jobj):
 INDEX_PATTERN_BODY = {
     "type": "index-pattern",
     "index-pattern": {
-        "timeFieldName": "performance.@timestamp",
-        "title": '{}-{}'.format(BODY[BODY['type']]['project'],
-                                BODY[BODY['type']]['subject'])
+        "timeFieldName": "@timestamp",
+        "title": '{}-{}'.format(BODY['project'],
+                                BODY['subject'])
     }
 }
 
 
 KIBANA_CONFIG = {'config': {
-    'defaultIndex': 'pattern-for-{}-{}'.format(BODY[BODY['type']]['project'],
-                                               BODY[BODY['type']]['subject']),
+    'defaultIndex': 'pattern-for-{}-{}'.format(BODY['project'],
+                                               BODY['subject']),
     'timepicker:timeDefaults': '{\n  "from": "now-5y",\n \
                                 "to": "now",\n  "mode": "quick"\n}',
     'xPackMonitoring:showBanner': False},
@@ -160,7 +160,7 @@ res = es.index(index='.kibana', doc_type='doc',
 try:
     index = '.kibana'
     ES_ID = 'index-pattern:pattern-for-{}-{}'.format(
-        BODY[BODY['type']]['project'], BODY[BODY['type']]['subject'])
+        BODY['project'], BODY['subject'])
     res = es.index(index=index, doc_type='doc',
                    id=ES_ID, body=INDEX_PATTERN_BODY)
     p(json.dumps(INDEX_PATTERN_BODY, indent=4))
index 6ea4d3c06bf4961c188aba98d6decd544cf093e4..e4a160c792d989abbf6c8f73bf3ac3d65946b9db 100644 (file)
@@ -13,7 +13,7 @@ bgpcep:
                 values: from default
       filter:
         1:
-            field: performance.test-name
+            field: test-name
             match-with: bgpcep-csit-1node-userfeatures-all-oxygen
       co_ords:
         h: 3
@@ -30,7 +30,7 @@ bgpcep:
                 values: from default
       filter:
         1:
-            field: performance.test-name
+            field: test-name
             match-with: bgpcep-csit-1node-userfeatures-all-fluorine
       co_ords:
         h: 3
@@ -48,12 +48,12 @@ bgpcep:
                 title: BGP updates/sec
         series:
           1:
-            field: performance.plots.totals-bgp.+10/-9 routes per UPDATE
-            label: Config DS
+            field: plots.performance-bgp.+10/-9 routes per UPDATE
+            label: +10/-9 routes per UPDATE
             color: red
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: bgpcep-csit-1node-bgp-ingest-mixed-all-oxygen
       co_ords:
         h: 3
@@ -71,12 +71,12 @@ bgpcep:
                 title: BGP updates/sec
         series:
           1:
-            field: performance.plots.totals-bgp.+10/-9 routes per UPDATE
-            label: Config DS
+            field: plots.performance-bgp.+10/-9 routes per UPDATE
+            label: +10/-9 routes per UPDATE
             color: red
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: bgpcep-csit-1node-bgp-ingest-mixed-all-fluorine
       co_ords:
         h: 3
@@ -99,8 +99,8 @@ openflowplugin:
                 values: from default
       filter:
         1:
-            field: performance.test-name
-            match-with: openflowplugin-csit-1node-flow-services-only-oxygen
+            field: test-name
+            match-with: openflowplugin-csit-1node-flow-services-all-oxygen
       co_ords:
         h: 3
         w: 6
@@ -116,8 +116,8 @@ openflowplugin:
                 values: from default
       filter:
         1:
-            field: performance.test-name
-            match-with: openflowplugin-csit-1node-flow-services-only-fluorine
+            field: test-name
+            match-with: openflowplugin-csit-1node-flow-services-all-fluorine
       co_ords:
         h: 3
         w: 6
@@ -133,7 +133,7 @@ openflowplugin:
                 values: from default
       filter:
         1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-3node-clustering-only-oxygen
       co_ords:
         h: 3
@@ -150,7 +150,7 @@ openflowplugin:
                 values: from default
       filter:
         1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-3node-clustering-only-fluorine
       co_ords:
         h: 3
@@ -168,20 +168,20 @@ openflowplugin:
                 title: flowmods/sec
         series:
           1:
-            field: performance.plots.rate.Config DS
+            field: plots.rate.Config DS
             label: Config DS
             color: red
           2:
-            field: performance.plots.rate.OVS Switch
+            field: plots.rate.OVS Switch
             label: OVS Switch
             color: green
           3:
-            field: performance.plots.rate.Operational DS
+            field: plots.rate.Operational DS
             label: Operational DS
             color: blue
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-1node-perf-bulkomatic-only-oxygen
       co_ords:
         h: 3
@@ -199,20 +199,20 @@ openflowplugin:
                 title: flowmods/sec
         series:
           1:
-            field: performance.plots.rate.Config DS
+            field: plots.rate.Config DS
             label: Config DS
             color: red
           2:
-            field: performance.plots.rate.OVS Switch
+            field: plots.rate.OVS Switch
             label: OVS Switch
             color: green
           3:
-            field: performance.plots.rate.Operational DS
+            field: plots.rate.Operational DS
             label: Operational DS
             color: blue
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-1node-perf-bulkomatic-only-fluorine
       co_ords:
         h: 3
@@ -230,20 +230,20 @@ openflowplugin:
                 title: flowmods/sec
         series:
           1:
-            field: performance.plots.rate.Config DS
+            field: plots.rate.Config DS
             label: Config DS
             color: red
           2:
-            field: performance.plots.rate.OVS Switch
+            field: plots.rate.OVS Switch
             label: OVS Switch
             color: green
           3:
-            field: performance.plots.rate.Operational DS
+            field: plots.rate.Operational DS
             label: Operational DS
             color: blue
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-3node-clustering-perf-bulkomatic-only-oxygen
       co_ords:
         h: 3
@@ -261,20 +261,20 @@ openflowplugin:
                 title: flowmods/sec
         series:
           1:
-            field: performance.plots.rate.Config DS
+            field: plots.rate.Config DS
             label: Config DS
             color: red
           2:
-            field: performance.plots.rate.OVS Switch
+            field: plots.rate.OVS Switch
             label: OVS Switch
             color: green
           3:
-            field: performance.plots.rate.Operational DS
+            field: plots.rate.Operational DS
             label: Operational DS
             color: blue
       filter:
           1:
-            field: performance.test-name
+            field: test-name
             match-with: openflowplugin-csit-3node-clustering-perf-bulkomatic-only-fluorine
       co_ords:
         h: 3
index 51f29b5d878f95154d49052e6b82479cb08e54c9..44aa7f044c2606cb2defc98a853362bfe05bc3e2 100644 (file)
@@ -11,7 +11,7 @@ opendaylight-test-feature:
         pass:
             data_type: histogram
             mode: stacked
-            field: performance.pass-tests
+            field: pass-tests
             label: Pass tests
             schema: metric
             value_axis: 1
@@ -19,13 +19,13 @@ opendaylight-test-feature:
         fail:
             data_type: histogram
             mode: stacked
-            field: performance.fail-tests
+            field: fail-tests
             label: Fail tests
             schema: metric
             value_axis: 1
             color: red
         build:
-            field: performance.test-run
+            field: test-run
             label: Build Number
             schema: segment
             not_in_seriesParams: true
@@ -45,7 +45,7 @@ opendaylight-test-performance:
             value_axis: 1
     aggs:
         build:
-            field: performance.test-run
+            field: test-run
             custom_label: Build Number
             schema: segment
         default: