Add Kibana visualizations examples for NDR result
[nfvbench.git] / kibana / visualizations / ndr_capacity_gbps_line_chart.json
1 {
2   $schema: https: //vega.github.io/schema/vega-lite/v2.json
3   title: "Capacity in Gbps - 0,001% loss ratio"
4   data: {
5     url: {
6       %context%: true
7       %timefield%: "@timestamp"
8       index: resu*
9       body: {
10         _source: ["@timestamp", "_source", "offered_tx_rate_bps", "flow_count", "frame_size", "user_label"]
11       },
12       size: 10000
13     },
14     format: { property: "hits.hits" }
15   },
16   transform: [
17         { calculate: "datum._source['offered_tx_rate_bps'] / 1000000000" as: "offered_load_gbps"},
18         { calculate: "datum._source['flow_count']" as: "flow_count"},
19         { calculate: "isNaN(toNumber(datum._source['frame_size'])) ? 362 : toNumber(datum._source['frame_size'])" as: "frame_size"},
20         { calculate: "datum._source['user_label'] + '-' + datum._source['flow_count']" as: "label"}
21         { aggregate: [{op: "max", field: "offered_load_gbps", as: "max_offered_load_gbps"}], groupby: ["frame_size", "label","flow_count"]}
22   ],
23   center: true,
24   hconcat: [
25     {
26       width:10,
27       selection: {
28         legendSel: {
29           type: "multi",
30           encodings: [ "color", "shape" ],
31           toggle: "event.shiftKey"
32         }
33       },
34       encoding: {
35         y: {
36           field: "label",
37           type: "nominal",
38           axis: {
39             title: "",
40             domain: false,
41             ticks: false,
42             offset: 10
43           },
44         },
45         color: {
46           condition: {
47             selection: "legendSel",
48             field: "label",
49             type: "nominal",
50             legend: null
51           },
52           value: "lightgrey"
53         }
54       },
55       mark: {
56         type: "square",
57         size: 120,
58         opacity: 1
59       }
60     },
61     {
62       width:500,
63       height:280,
64       transform: [
65         {filter: { selection: "legendSel"}}
66       ],
67       mark: {
68         type: "line",
69         tooltip: true,
70         point: true
71       },
72       selection: {
73           grid: {
74             type: "interval",
75             resolve: "global",
76             bind: "scales",
77             translate: "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!",
78             zoom: "wheel![!event.shiftKey]"
79           },
80           pts: {
81             type: "single",
82             fields: ["label"]
83           }
84       },
85       encoding: {
86         x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
87         y: { field: "max_offered_load_gbps", type: "quantitative", title: "Offered load (Gbps)" , axis: {offset: 10}  }
88         color: {field: "label", "type": "nominal",
89               "legend": null}
90        shape: {field: "flow_count", type: "nominal"}
91         tooltip: {"field": "max_offered_load_gbps", "type": "quantitative"}
92       }
93     }
94   ]
95 }