summaryrefslogtreecommitdiff
path: root/elastic/generate-config.py
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-04-13 12:31:32 +0200
committervarac <varacanero@zeromail.org>2017-04-13 12:31:32 +0200
commitbb50e1acf02dd4ec3c084f27a5336e87c9ad1bee (patch)
treee7517390d833503560e16324acd9689c1f3ad66a /elastic/generate-config.py
parent1fb4bab60824a5bee811db93f123ab121f0f0fc8 (diff)
Use functions in generate-config.py
Diffstat (limited to 'elastic/generate-config.py')
-rwxr-xr-xelastic/generate-config.py47
1 files changed, 34 insertions, 13 deletions
diff --git a/elastic/generate-config.py b/elastic/generate-config.py
index f26d03d..e5e8547 100755
--- a/elastic/generate-config.py
+++ b/elastic/generate-config.py
@@ -6,7 +6,7 @@ import pystache
tests = [
'test_encrypt_raw_10M',
- # 'test_encrypt_raw_100k',
+ 'test_encrypt_raw_100k',
# 'test_encrypt_raw_10k',
# 'test_decrypt_raw_100k',
# 'test_decrypt_raw_10M',
@@ -27,21 +27,42 @@ tests = [
#'test_decrypt_doc_1M'
]
-DIR = './visualization/'
-template = open(DIR + 'template.mustache', 'r').read()
-for test in tests:
- out_file = DIR + test + '.json'
+# Generate visualizations
+def generate_visualizations():
+ dir = './visualization/'
+ template = open(dir + 'template.mustache', 'r').read()
+
+ for test in tests:
+ out_file = dir + test + '.json'
+ print('Generating ' + out_file)
+ context = {
+ 'title': test,
+ 'query': "commit_info.project:soledad AND commit_info.branch='master' AND machine_info.host='weasel' AND name='" + test + "'"
+ }
+
+ rendered = pystache.render(template, context)
+ #print(context)
+
+ out = open(out_file, 'w')
+ out.write(rendered)
+ out.flush()
+
+# Generate Dashboard
+def generate_dashboards():
+ dir = './dashboard/'
+ template = open(dir + 'template.mustache', 'r').read()
+ out_file = dir + test + '.json'
print('Generating ' + out_file)
- context = {
- 'title': test,
- 'query': "commit_info.project:soledad AND commit_info.branch='master' AND machine_info.host='weasel' AND name='" + test + "'"
- }
+
+ item = q
+
+ for test in tests:
+ dashboards = dashboards + ''
rendered = pystache.render(template, context)
- #print(context)
+ print(rendered)
- out = open(out_file, 'w')
- out.write(rendered)
- out.flush()
+generate_visualizations()
+#generate_dashboards()