summaryrefslogtreecommitdiff
path: root/elastic/generate-config.py
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2017-04-11 16:59:55 +0200
committervarac <varacanero@zeromail.org>2017-04-11 16:59:55 +0200
commit1fb4bab60824a5bee811db93f123ab121f0f0fc8 (patch)
tree4a62d5a93e061a5646b3f1f9c0c5a59ac151175e /elastic/generate-config.py
parente4bd0b13fb7970d572056f633bd40a3403d12681 (diff)
Generate visualisartions from mustache template
Diffstat (limited to 'elastic/generate-config.py')
-rwxr-xr-xelastic/generate-config.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/elastic/generate-config.py b/elastic/generate-config.py
new file mode 100755
index 0000000..f26d03d
--- /dev/null
+++ b/elastic/generate-config.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python3
+
+import pystache
+
+#print(pystache.render('Hi {{person}}!', {'person': 'Mom'}))
+
+tests = [
+ 'test_encrypt_raw_10M',
+ # 'test_encrypt_raw_100k',
+ # 'test_encrypt_raw_10k',
+ # 'test_decrypt_raw_100k',
+ # 'test_decrypt_raw_10M',
+ # 'test_decrypt_raw_10k',
+ # 'test_decrypt_raw_1M',
+ # 'test_decrypt_raw_500k',
+ # 'test_encrypt_raw_1M',
+ # 'test_encrypt_raw_500k',
+ # 'test_initialization',
+ # 'test_async_create_1000_10k',
+ # 'test_async_create_100_100k',
+ # 'test_create_1000_10k',
+ # 'test_create_100_100k',
+ # 'test_create_20_500k',
+ # 'test_decrypt_doc_100k',
+ # 'test_decrypt_doc_10M',
+ # 'test_decrypt_doc_10k',
+ #'test_decrypt_doc_1M'
+ ]
+
+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()