68c3d38deb60ddeef9780775e36606799e14e1d6
[nfvbench.git] / docs / testing / user / userguide / kibana.rst
1 NFVbench Kibana visualization: overview
2 =======================================
3
4 The fluentd integration offers the possibility to use elasticsearch and kibana as a visualization chain.
5
6 Chain overview:
7
8 .. image:: images/nfvbench-kibana.png
9
10 Example of NFVbench visualizations
11 ----------------------------------
12
13 Kibana offers a lot of visualization type (line and bar charts, pie, time series chart, data table ...) and also provide a plugin to develop graph using Vega.
14 In the below examples, visualizations are based on an NDR result and are developed using `Vega-lite <https://vega.github.io/vega-lite-v2>`_.
15 Data are aggregated using ``user_label`` and ``flow_count`` properties.
16
17 In ``kibana/visualizations/`` pre-created graphs are available into json files.
18
19 For NDR capacity in Gbps using line chart, the offered load in Gbps (``offered_tx_rate_bps``) is used and only the maximum value of the aggregation is kept.
20 For NDR capacity in Mpps using line chart, the actual TX rate is used (``rate_pps``) and only the maximum value of the aggregation is kept.
21
22 Scatter plot graphs use the same values but keep all values instead of keeping maximum.
23
24 Example of a line chart:
25
26 .. image:: images/nfvbench-kibana-gbps-line.png
27
28 Example of a scatter plot chart:
29
30 .. image:: images/nfvbench-kibana-pps-scatter.png
31
32 Vega offers the possibility to add another graph as a new layer of current graph.
33 This solution is used to combine NFVbench results and theoretical line rate.
34 Using ``extra_encapsulation_bytes`` in --user-info property (see `User info data section <https://opnfv-nfvbench.readthedocs.io/en/latest/testing/user/userguide/advanced.html#user-info-data>`_),
35 the theoretical max value (for bps and pps) will be calculated and can be used in graph through ``theoretical_tx_rate_bps`` and ``theoretical_tx_rate_pps`` properties.
36
37 Example of chart with theoretical value (red line):
38
39 .. image:: images/nfvbench-kibana-pps-theoretical.png
40
41 Each Vega graph can be moved, zoomed (using mouse scroll) and one set of data can be selected.
42
43 Example:
44
45 .. image:: images/nfvbench-kibana-zoom-selection.png
46
47 These visualizations are included into Kibana dashboard for a synthesis of one set of result (i.e. same ``user_label`` value) or for comparison (i.e. a selection of ``user_label`` values).
48 See :ref:`filterkibana` for more details about ``user_label`` selection.
49
50 All these visualizations and dashboards are saved into the ``export.ndjson`` file and can be imported in an existing Kibana. See :ref:`importkibana`.
51
52 .. _importkibana:
53
54 Import Kibana dashboards and visualization
55 ------------------------------------------
56
57 To import Kibana dashboard and visualization:
58
59 .. code-block:: bash
60
61     curl -X POST localhost:5601/api/saved_objects/_import -H "kbn-xsrf: true" --form file=@export.ndjson
62
63 .. note:: ``.kibana`` index must exists in elasticsearch.
64 .. note:: ``.kibana`` index is created automatically after a first deployment and configuration of Kibana.
65
66 .. _filterkibana:
67
68 Kibana user guide: Filter dashboards and visualizations
69 =======================================================
70
71 Filter Kibana dashboard or visualization using Kibana query language (KQL)
72 --------------------------------------------------------------------------
73
74 .. code-block:: bash
75
76     user_label:*demo* and (flow_count: 128 or flow_count:130000 or flow_count:1000000)
77
78 .. note:: This query will filter all user label which contains ``demo`` in the value and filter 3 flow count (128, 130k, 1M).
79 .. note:: ``flow_count`` is a number so KQL query can not contain formatted string.
80
81 Example:
82
83 .. image:: images/nfvbench-kibana-filter-kql.png
84
85
86 Filter Kibana dashboard or visualization using Kibana filters
87 -------------------------------------------------------------
88
89 Kibana offers the possibility to add filter by selecting field and operator (is, is not, is one of, is not one of, exists, does not exist).
90
91 Example:
92
93 .. image:: images/nfvbench-kibana-filter.png