6333d09173b5fdb6d4a35c904ca55f08c16433e0
[kvmfornfv.git] / docs / userguide / kvmfornfv.cyclictest-dashboard.userguide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2
3 .. http://creativecommons.org/licenses/by/4.0
4
5 ========================================
6 Dashboard for KVM4NFV Daily Test Results
7 ========================================
8
9 Abstract
10 ========
11
12 This chapter explains the procedure to configure the InfluxDB and Grafana on Node1 or Node2
13 depending on the testtype to publish KVM4NFV cyclic test results. The cyclictest cases are executed
14 and results are published on Yardstick Dashboard(Graphana).  InfluxDB is the database which will
15 store the cyclictest results and Grafana is a visualisation suite to view the maximum,minumum and
16 average values of the timeseries data of cyclictest results.The framework is shown in below image.
17
18 .. Figure:: ../images/dashboard-architecture.png
19
20
21 Version Features
22 ================
23
24 +-----------------------------+--------------------------------------------+
25 |                             |                                            |
26 |      **Release**            |               **Features**                 |
27 |                             |                                            |
28 +=============================+============================================+
29 |                             | - Data published in Json file Format       |
30 |       Colorado              | - No database support to store the test's  |
31 |                             |   latency values of cyclictest             |
32 |                             | - For each run, the previous run's output  |
33 |                             |   file is replaced with a new file with    |
34 |                             |   currents latency values.                 |
35 +-----------------------------+--------------------------------------------+
36 |                             | - Test results are stored in Influxdb      |
37 |                             | - Graphical representation of the latency  |
38 |       Danube                |   values using Grafana suite. (Dashboard)  |
39 |                             | - Supports Graphical view for multiple     |
40 |                             |   testcases and test-types (Stress/Idle)   |
41 +-----------------------------+--------------------------------------------+
42
43
44 Installation Steps:
45 ===================
46 To configure Yardstick, InfluxDB and Grafana for KVMFORNFV project following sequence of steps are followed:
47
48 **Note:**
49
50 All the below steps are done as per the script, which is a part of CICD integration.
51
52 .. code:: bash
53
54    For Yardstick:
55    git clone https://gerrit.opnfv.org/gerrit/yardstick
56
57    For InfluxDB:
58    docker pull tutum/influxdb
59    docker run -d --name influxdb -p 8083:8083 -p 8086:8086 --expose 8090 --expose 8099 tutum/influxdb
60    docker exec -it influxdb bash
61    $influx
62    >CREATE USER root WITH PASSWORD 'root' WITH ALL PRIVILEGES
63    >CREATE DATABASE yardstick;
64    >use yardstick;
65    >show MEASUREMENTS;
66
67    For Grafana:
68    docker pull grafana/grafana
69    docker run -d --name grafana -p 3000:3000 grafana/grafana
70
71 The Yardstick document for Grafana and InfluxDB configuration can be found `here`_.
72
73 .. _here: https://wiki.opnfv.org/display/yardstick/How+to+deploy+InfluxDB+and+Grafana+locally
74
75 Configuring the Dispatcher Type:
76 ================================
77 Need to configure the dispatcher type in /etc/yardstick/yardstick.conf depending on the dispatcher
78 methods which are used to store the cyclictest results. A sample yardstick.conf can be found at
79 /yardstick/etc/yardstick.conf.sample, which can be copied to /etc/yardstick.
80
81 .. code:: bash
82
83     mkdir -p /etc/yardstick/
84     cp /yardstick/etc/yardstick.conf.sample /etc/yardstick/yardstick.conf
85
86 **Dispatcher Modules:**
87
88 Three type of dispatcher methods are available to store the cyclictest results.
89
90 - File
91 - InfluxDB
92 - HTTP
93
94 **1. File**:  Default Dispatcher module is file.If the dispatcher module is configured as a file,then the test results are stored in yardstick.out  file.
95 ( default path: /tmp/yardstick.out).
96 Dispatcher module of "Verify Job" is "Default".So,the results are stored in Yardstick.out file for verify job. Storing all the verify jobs in InfluxDB database causes redundancy of latency values. Hence, a File output format is prefered.
97
98 .. code:: bash
99
100     [DEFAULT]
101     debug = False
102     dispatcher = file
103
104 **2. Influxdb**: If the dispatcher module is configured as influxdb, then the test results are stored in Influxdb.Users can check test results stored in the Influxdb(Database) on Grafana which is used to visualize the time series data.
105
106 To configure the influxdb ,the following content in /etc/yardstick/yardstick.conf need to updated
107
108 .. code:: bash
109
110     [DEFAULT]
111     debug = False
112     dispatcher = influxdb
113
114 Dispatcher module of "Daily Job" is Influxdb.So the results are stored in influxdb and then published to Dashboard.
115
116 **3. HTTP**: If the dispatcher module is configured as http, users can check test result on OPNFV testing dashboard which uses MongoDB as backend.
117
118 .. code:: bash
119
120     [DEFAULT]
121     debug = False
122     dispatcher = http
123
124 .. Figure:: ../images/UseCaseDashboard.png
125
126
127 Detailing the dispatcher module in verify and daily Jobs:
128 ---------------------------------------------------------
129
130 KVM4NFV updates the dispatcher module in the yardstick configuration file(/etc/yardstick/yardstick.conf) depending on the Job type(Verify/Daily).Once the test is completed, results are published to the respective dispatcher modules.
131
132 Dispatcher module is configured for each Job type as mentioned below.
133
134 1. ``Verify Job`` : Default "DISPATCHER_TYPE" i.e. file(/tmp/yardstick.out) is used. User can also see the test results on Jenkins console log.
135
136 .. code:: bash
137
138      *"max": "00030", "avg": "00006", "min": "00006"*
139
140 2. ``Daily Job`` : Opnfv Influxdb url is configured as dispatcher module.
141
142 .. code:: bash
143
144      DISPATCHER_TYPE=influxdb
145      DISPATCHER_INFLUXDB_TARGET="http://104.197.68.199:8086"
146
147 Influxdb only supports line protocol, and the json protocol is deprecated.
148
149 For example, the raw_result of cyclictest in json format is:
150    ::
151
152     "benchmark": {
153          "timestamp": 1478234859.065317,
154          "errors": "",
155          "data": {
156             "max": "00012",
157             "avg": "00008",
158             "min": "00007"
159          },
160        "sequence": 1
161        },
162       "runner_id": 23
163     }
164
165
166 With the help of "influxdb_line_protocol", the json is transformed as a line string:
167    ::
168
169      'kvmfornfv_cyclictest_idle_idle,deploy_scenario=unknown,host=kvm.LF,
170      installer=unknown,pod_name=unknown,runner_id=23,scenarios=Cyclictest,
171      task_id=e7be7516-9eae-406e-84b6-e931866fa793,version=unknown
172      avg="00008",max="00012",min="00007" 1478234859065316864'
173
174
175
176 Influxdb api which is already implemented in `Influxdb`_ will post the data in line format into the database.
177
178 ``Displaying Results on Grafana dashboard:``
179
180 - Once the test results are stored in Influxdb, dashboard configuration file(Json) which used to display the cyclictest results on Grafana need to be created by following the `Grafana-procedure`_ and then pushed into `yardstick-repo`_
181
182 - Grafana can be accessed at `Login`_ using credentials opnfv/opnfv and used for visualizing the collected test data as shown in `Visual`_\
183
184
185 .. Figure:: ../images/Dashboard-screenshot-1.png
186
187 .. Figure:: ../images/Dashboard-screenshot-2.png
188
189 .. _Influxdb: https://git.opnfv.org/cgit/yardstick/tree/yardstick/dispatcher/influxdb.py
190
191 .. _Visual: http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest
192
193 .. _Login: http://testresults.opnfv.org/grafana/login
194
195 .. _Grafana-procedure: https://wiki.opnfv.org/display/yardstick/How+to+work+with+grafana+dashboard
196
197 .. _yardstick-repo: https://git.opnfv.org/cgit/yardstick/tree/dashboard/KVMFORNFV-Cyclictest
198
199 .. _GrafanaDoc: http://docs.grafana.org/
200
201 Understanding Kvmfornfv Grafana Dashboard
202 =========================================
203
204 The Kvmfornfv Dashboard found at http://testresults.opnfv.org/ currently supports graphical view of Cyclictest. For viewing Kvmfornfv Dashboard use,
205
206 .. code:: bash
207
208     http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest
209
210     The login details are:
211
212         Username: opnfv
213         Password: opnfv
214
215 The Dashboard has four tables, each representing a specific test-type of cyclictest case,
216
217 - Kvmfornfv_Cyclictest_Idle-Idle
218 - Kvmfornfv_Cyclictest_CPUstress-Idle
219 - Kvmfornfv_Cyclictest_Memorystress-Idle
220 - Kvmfornfv_Cyclictest_IOstress-Idle
221
222 Note:
223
224 - For all graphs, X-axis is marked with time stamps, Y-axis with value in microsecond units.
225
226 **A brief about what each graph of the dashboard represents:**
227
228 1. Idle-Idle Graph
229 -------------------
230 `Idle-Idle`_ graph displays the Average,Maximum and Minimum latency values obtained by running Idle_Idle test-type of the Cyclictest. Idle_Idle implies that no stress is applied on the Host or the Guest.
231
232 .. _Idle-Idle: http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest?panelId=10&fullscreen
233
234 .. Figure:: ../images/Idle-Idle.png
235
236 2. CPU_Stress-Idle Graph
237 --------------------------
238 `Cpu_Stress-Idle`_ graph displays the Average,Maximum and Minimum latency values obtained by running Idle_Idle test-type of the Cyclictest. Idle_Idle implies that CPU stress is applied on the Host and no stress on the Guest.
239
240 .. _Cpu_stress-Idle: http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest?panelId=11&fullscreen
241
242 .. Figure:: ../images/Cpustress-Idle.png
243
244 3. Memory_Stress-Idle Graph
245 ----------------------------
246 `Memory_Stress-Idle`_ graph displays the Average,Maximum and Minimum latency values obtained by running Idle_Idle test-type of the Cyclictest. Idle_Idle implies that Memory stress is applied on the Host and no stress on the Guest.
247
248 .. _Memory_Stress-Idle: http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest?panelId=12&fullscreen
249
250 .. Figure:: ../images/Memorystress-Idle.png
251
252 4. IO_Stress-Idle Graph
253 ------------------------
254 `IO_Stress-Idle`_ graph displays the Average,Maximum and Minimum latency values obtained by running Idle_Idle test-type of the Cyclictest. Idle_Idle implies that IO stress is applied on the Host and no stress on the Guest.
255
256 .. _IO_Stress-Idle: http://testresults.opnfv.org/grafana/dashboard/db/kvmfornfv-cyclictest?panelId=13&fullscreen
257
258 .. Figure:: ../images/IOstress-Idle.png