From 8d1e4e9c07a79e6601acc24f090b2bb534114550 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 13 Apr 2017 17:02:59 +0200 Subject: Finish dashboard --- elastic/dashboard/template.mustache | 2 +- elastic/generate-config.py | 13 ++++++++++++- elastic/load.sh | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'elastic') diff --git a/elastic/dashboard/template.mustache b/elastic/dashboard/template.mustache index 4d66954..0b31c82 100644 --- a/elastic/dashboard/template.mustache +++ b/elastic/dashboard/template.mustache @@ -2,7 +2,7 @@ "title": "Soledad-Benchmarks", "hits": 0, "description": "All Soledad benchmak tests run on Weasel", - "panelsJSON": "[{{#tests}} {\"col\":1,\"id\":\"{{name}}\",\"panelIndex\":1,\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"}, {{/tests}}{\"col\":1,\"id\":\"test_decrypt_doc_1M\",\"panelIndex\":1,\"row\":1,\"size_x\":6,\"size_y\":3,\"type\":\"visualization\"} ]", + "panelsJSON": "{{{panels_json}}}", "optionsJSON": "{\"darkTheme\":true}", "uiStateJSON": "{}", "version": 1, diff --git a/elastic/generate-config.py b/elastic/generate-config.py index 49a6209..31c8e3a 100755 --- a/elastic/generate-config.py +++ b/elastic/generate-config.py @@ -59,7 +59,18 @@ def generate_dashboards(): out_file = dir + 'soledad-benchmarks.json' print('Generating ' + out_file) - rendered = pystache.render(template, tests) + panels = '[' + count = 0 + for test in tests['tests']: + test_name = test['name'] + count += 1 + panels += '{\\"id\\":\\"' + test_name + '\\",\\"panelIndex\\":' + str(count) + ',\\"col\\":1,\\"row\\":' + str(count) + ',\\"size_x\\":6,\\"size_y\\":3,\\"type\\":\\"visualization\\"}, ' + panels = panels[:-2] + panels += ']' + + print(panels) + panels_json = { 'panels_json': panels } + rendered = pystache.render(template, panels_json) #print(rendered) out = open(out_file, 'w') diff --git a/elastic/load.sh b/elastic/load.sh index a50083a..f46466a 100755 --- a/elastic/load.sh +++ b/elastic/load.sh @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash # # from https://raw.githubusercontent.com/elastic/beats-dashboards/master/load.sh -- cgit v1.2.3