Add Kibana visualizations examples for NDR result
[nfvbench.git] / kibana / visualizations / ndr_capacity_pps_theoretical_line_chart.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", "theoretical_tx_rate_pps", "rate_pps", "flow_count", "frame_size", "user_label", "type"]
11       },
12       size: 10000
13     },
14     format: { property: "hits.hits" }
15   },
16
17   transform: [
18         { calculate: "datum._source['rate_pps'] / 1000000" as: "offered_load_pps"},
19         { calculate: "datum._source['theoretical_tx_rate_pps'] / 1000000" as: "theoretical_tx_rate_pps"},
20         { calculate: "datum._source['flow_count']" as: "flow_count"},
21         { calculate: "isNaN(toNumber(datum._source['frame_size'])) ? 362 : toNumber(datum._source['frame_size'])" as: "frame_size"},
22         { calculate: "datum._source['user_label'] + '-' + datum._source['flow_count']" as: "label"}
23         { aggregate: [{op: "max", field: "offered_load_pps", as: "max_offered_load_pps"}, {op: "max", field: "theoretical_tx_rate_pps", as: "theoretical_tx_rate_pps"}], groupby: ["frame_size", "label","flow_count"]}
24     
25     ],
26   center: true,
27   hconcat: [
28   {
29       width:10,
30       selection: {
31         legendSel: {
32           type: "multi",
33           encodings: [ "color", "shape" ],
34           toggle: "event.shiftKey"
35         }
36       },
37       encoding: {
38         y: {
39           field: "label",
40           type: "nominal",
41           axis: {
42             title: "",
43             domain: false,
44             ticks: false,
45             offset: 10
46           },
47         },
48         color: {
49           condition: {
50             selection: "legendSel",
51             field: "label",
52             type: "nominal",
53             legend: null
54           },
55           value: "lightgrey"
56         }
57       },
58       mark: {
59         type: "square",
60         size: 120,
61         opacity: 1
62       }
63     },
64     {
65     layer: [{
66     mark: {
67       type: "line",
68       tooltip: true,
69       point: true
70     },
71     encoding: {
72       x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
73       y: { field: "theoretical_tx_rate_pps", type: "quantitative", title: "Offered load (Mpps)" , axis: {offset: 10}  }
74       strokeDash: {"field": "theoretical_tx_rate_pps", "type": "nominal"}
75       tooltip: [{"field": "theoretical_tx_rate_pps", "type": "quantitative", title: "theoretical max capacity"}],
76       color: { "value": "red"}
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_pps", type: "quantitative", title: "Offered load (Mpps)" , axis: {offset: 10}  }
105       color: {field: "label", "type": "nominal",
106              "legend": null}
107       tooltip: {"field": "max_offered_load_pps", "type": "quantitative"},
108      shape: {field: "flow_count", type: "nominal"}
109       }
110     }
111     ]
112   }
113     
114   ]
115 }