aboutsummaryrefslogtreecommitdiffstats
path: root/kibana/visualizations/ndr_capacity_gbps_theoretical_line_chart.json
blob: 1ff4d23a3409ab8d348ca6d9a7c35483ed4314fa (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
  $schema: https: //vega.github.io/schema/vega-lite/v2.json
  title: "Capacity in Gbps - 0,001% loss ratio"
  data: {
    url: {
      %context%: true
      %timefield%: "@timestamp"
      index: resu*
      body: {
        _source: ["@timestamp", "_source", "offered_tx_rate_bps", "theoretical_tx_rate_bps", "flow_count", "frame_size", "user_label"]
      },
      size: 10000
    },
    format: { property: "hits.hits" }
  },
  transform: [
        { calculate: "datum._source['offered_tx_rate_bps'] / 1000000000" as: "offered_load_gbps"},
        { calculate: "datum._source['theoretical_tx_rate_bps'] / 1000000000" as: "theoretical_tx_rate_bps"},
        { calculate: "datum._source['flow_count']" as: "flow_count"},
        { calculate: "isNaN(toNumber(datum._source['frame_size'])) ? 362 : toNumber(datum._source['frame_size'])" as: "frame_size"},
        { calculate: "datum._source['user_label'] + '-' + datum._source['flow_count']" as: "label"}
        { 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"]}
  ],
  center: true,
  hconcat: [
    {
      width:10,
      selection: {
        legendSel: {
          type: "multi",
          encodings: [ "color", "shape" ],
          toggle: "event.shiftKey"
        }
      },
      encoding: {
        y: {
          field: "label",
          type: "nominal",
          axis: {
            title: "",
            domain: false,
            ticks: false,
            offset: 10
          },
        },
        color: {
          condition: {
            selection: "legendSel",
            field: "label",
            type: "nominal",
            legend: null
          },
          value: "lightgrey"
        }
      },
      mark: {
        type: "square",
        size: 120,
        opacity: 1
      }
    },
    {
      layer: [
        {
          mark: {
            type: "line",
            tooltip: true,
            point: true
          },
          encoding: {
            x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
            y: { field: "theoretical_tx_rate_bps", type: "quantitative", title: "Theoretical rate (Gbps)" , axis: {offset: 10}  }
            strokeDash: {"field": "theoretical_tx_rate_bps", "type": "nominal"}
            tooltip: [{"field": "theoretical_tx_rate_bps", "type": "quantitative", title: "theoretical max capacity"}],
            color: { "value": "red"}
          }
        },
        {
          width:500,
          height:280,
          transform: [
            {filter: { selection: "legendSel"}}
          ],
          mark: {
            type: "line",
            tooltip: true,
            point: true
          },
          selection: {
              grid: {
                type: "interval",
                resolve: "global",
                bind: "scales",
                translate: "[mousedown[!event.shiftKey], window:mouseup] > window:mousemove!",
                zoom: "wheel![!event.shiftKey]"
              },
              pts: {
                type: "single",
                fields: ["Label"]
              }
          },
          encoding: {
            x: { field: "frame_size", type: "quantitative", title: "Frame size (bytes)", axis: {offset: 10} }
            y: { field: "max_offered_load_gbps", type: "quantitative", title: "Offered load (Gbps)" , axis: {offset: 10}  }
            color: {field: "label", "type": "nominal",
                  "legend": null}
           shape: {field: "flow_count", type: "nominal"}
            tooltip: {"field": "max_offered_load_gbps", "type": "quantitative"}
          }
        }
      ]
    }
  ]
}