Add Kibana visualizations examples for NDR result
[nfvbench.git] / kibana / visualizations / ndr_capacity_gbps_theoretical_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", "theoretical_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['theoretical_tx_rate_bps'] / 1000000000" as: "theoretical_tx_rate_bps"},
19         { calculate: "datum._source['flow_count']" as: "flow_count"},
20         { calculate: "isNaN(toNumber(datum._source['frame_size'])) ? 362 : toNumber(datum._source['frame_size'])" as: "frame_size"},
21         { calculate: "datum._source['user_label'] + '-' + datum._source['flow_count']" as: "label"}
22         { aggregate: [{op: "max", field: "offered_load_gbps", as: "max_offered_load_gbps"}, {op: "max", field: "theoretical_tx_rate_bps", as: "theoretical_tx_rate_bps"}], groupby: ["frame_size", "label","flow_count"]}
23   ],
24   center: true,
25   hconcat: [
26     {
27       width:10,
28       selection: {
29         legendSel: {
30           type: "multi",
31           encodings: [ "color", "shape" ],
32           toggle: "event.shiftKey"
33         }
34       },
35       encoding: {
36         y: {
37           field: "label",
38           type: "nominal",
39           axis: {
40             title: "",
41             domain: false,
42             ticks: false,
43             offset: 10
44           },
45         },
46         color: {
47           condition: {
48             selection: "legendSel",
49             field: "label",
50             type: "nominal",
51             legend: null
52           },
53           value: "lightgrey"
54         }
55       },
56       mark: {
57         type: "square",
58         size: 120,
59         opacity: 1
60       }
61     },
62     {
63       layer: [
64         {
65           mark: {
66             type: "line",
67             tooltip: true,
68             point: true
69           },
70           encoding: {
71             x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
72             y: { field: "theoretical_tx_rate_bps", type: "quantitative", title: "Theoretical rate (Gbps)" , axis: {offset: 10}  }
73             strokeDash: {"field": "theoretical_tx_rate_bps", "type": "nominal"}
74             tooltip: [{"field": "theoretical_tx_rate_bps", "type": "quantitative", title: "theoretical max capacity"}],
75             color: { "value": "red"}
76           }
77         },
78         {
79           width:500,
80           height:280,
81           transform: [
82             {filter: { selection: "legendSel"}}
83           ],
84           mark: {
85             type: "line",
86             tooltip: true,
87             point: true
88           },
89           selection: {
90               grid: {
91                 type: "interval",
92                 resolve: "global",
93                 bind: "scales",
94                 translate: "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!",
95                 zoom: "wheel![!event.shiftKey]"
96               },
97               pts: {
98                 type: "single",
99                 fields: ["Label"]
100               }
101           },
102           encoding: {
103             x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
104             y: { field: "max_offered_load_gbps", type: "quantitative", title: "Offered load (Gbps)" , axis: {offset: 10}  }
105             color: {field: "label", "type": "nominal",
106                   "legend": null}
107            shape: {field: "flow_count", type: "nominal"}
108             tooltip: {"field": "max_offered_load_gbps", "type": "quantitative"}
109           }
110         }
111       ]
112     }
113   ]
114 }