summaryrefslogtreecommitdiffstats
path: root/dashboard/dashboard/elastic2kibana/templates/dashboard.json
blob: cc8099593639cb0b64ce8892a69ea357f247b9d0 (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
{% set db = db|default({}) -%}


{% macro calc_col(index) -%}
  {% if index is divisibleby 2 %}
    7
  {% else %}
    1
  {% endif %}
{%- endmacro %}

{% macro calc_row(index) -%}
{% set num = (index - 1)//2 %}
  {{1 + num * 3}}
{%- endmacro %}

{
  "description": "Kibana dashboard for {{db.query}}",
  "hits": 0,
  "kibanaSavedObjectMeta": {
    "searchSourceJSON": {
      "filter": [
        {
          "query": {
            "query_string": {
              "analyze_wildcard": true,
              "query": "*"
            }
          }
        }
      ]
    }
  },
  "metadata": {
    "label": "{{db.query.case_name}} {{db.query.metric}}",
    "test_family": "{{db.test_family}}"
  },
  "optionsJSON": {
    "darkTheme": false
  },
  "panelsJSON": [
    {% for id in db.ids %}
    {
      "col": {{calc_col(loop.index)}},
      "id": "{{id}}",
      "panelIndex": {{loop.index}},
      "row": {{calc_row(loop.index)}},
      "size_x": 6,
      "size_y": 3,
      "type": "visualization"
    }
    {% if not loop.last %}
    ,
    {% endif %}
    {% endfor %}
  ],
  "scenario": 1,
  "timeRestore": false,
  "title": "{{db.query.project_name}} {{db.query.case_name}} {{db.query.installer}} {{db.query.metric}} {{db.query.pod}}",
  "uiStateJSON": {}
}