summaryrefslogtreecommitdiff
path: root/elastic/generate-config.py
blob: e5e8547dbad97a13cd5796d006fd6f80a96f4fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/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'
    ]



# 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)

    item = q

    for test in tests:
        dashboards = dashboards + ''

    rendered = pystache.render(template, context)
    print(rendered)

generate_visualizations()
#generate_dashboards()