Add Kibana visualizations examples for NDR result
[nfvbench.git] / kibana / visualizations / ndr_capacity_pps_theoretical_scatter_plot.json
1 {
2   $schema: "https://vega.github.io/schema/vega-lite/v2.json"
3   title: "Capacity in Mpps - 0,001% loss ratio"
4   data: {
5     url: {
6       %context%: true
7       %timefield%: "@timestamp"
8       index: resu*
9       body: {
10         _source: ["@timestamp", "_source", "rate_pps", "theoretical_tx_rate_pps", "flow_count", "frame_size", "user_label"]
11       },
12       size: 10000
13     },
14     format: { property: "hits.hits" }
15   },
16   transform: [
17     { calculate: "datum._source['rate_pps'] / 1000000" as: "rate_pps"},
18         { calculate: "datum._source['theoretical_tx_rate_pps'] / 1000000" as: "theoretical_tx_rate_pps"},
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   ],
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       layer: [
63         {
64           mark: {
65             type: "line",
66             tooltip: true
67           },
68           encoding: {
69             x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
70             y: { field: "theoretical_tx_rate_pps", type: "quantitative", title: "Offered load (Mpps)" , axis: {offset: 10}  }
71             strokeDash: {"field": "theoretical_tx_rate_pps", "type": "nominal"}
72             tooltip: [{"field": "theoretical_tx_rate_pps", "type": "quantitative", title: "theoretical max capacity"}],
73             color: { "value": "red"}
74           }
75         },
76         {
77           width:500,
78           height:280,
79           transform: [
80             {filter: { selection: "legendSel"}}
81           ],
82           mark: {
83             "type": "point",
84             "tooltip": true
85           },
86           selection: {
87             grid: {
88               type: "interval",
89               resolve: "global",
90               bind: "scales",
91               translate: "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!",
92               zoom: "wheel![!event.shiftKey]"
93             },
94             pts: {
95               type: "single",
96               fields: ["label"]
97             }
98           },
99           encoding: {
100             x: {
101               field: "frame_size",
102               title: "Frame size (bytes)",
103               type: "quantitative"
104             }
105             y: {
106               field: "rate_pps",
107               title: "Offered load (Mpps)",
108               type: "quantitative"
109             }
110             color: {
111               field: "label", "type": "nominal",
112                    "legend": null
113             }
114             shape: {
115               field: "flow_count",
116               type: "nominal"
117             }
118             tooltip: {
119               "field": "rate_pps",
120               "title": "Offered load (Mpps)",
121               "type": "quantitative"
122             }
123           }
124         }
125       ]
126     }
127   ]
128 }