Merge "Make OvS max_idle & queues configuration optional"
[yardstick.git] / docs / testing / user / userguide / 07-result-store-InfluxDB.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International
2 .. License.
3 .. http://creativecommons.org/licenses/by/4.0
4 .. (c) OPNFV, 2016 Huawei Technologies Co.,Ltd and others.
5
6 ==============================================
7 Store Other Project's Test Results in InfluxDB
8 ==============================================
9
10 Abstract
11 ========
12
13 .. _Framework: https://wiki.opnfv.org/download/attachments/6827660/wiki.png?version=1&modificationDate=1470298075000&api=v2
14
15 This chapter illustrates how to run plug-in test cases and store test results
16 into community's InfluxDB. The framework is shown in Framework_.
17
18
19 .. image:: images/InfluxDB_store.png
20    :width: 800px
21    :alt: Store Other Project's Test Results in InfluxDB
22
23 Store Storperf Test Results into Community's InfluxDB
24 =====================================================
25
26 .. _Influxdb: https://git.opnfv.org/cgit/yardstick/tree/yardstick/dispatcher/influxdb.py
27 .. _Mingjiang: mailto:limingjiang@huawei.com
28 .. _Visual: https://wiki.opnfv.org/download/attachments/6827660/tc074.PNG?version=1&modificationDate=1470298075000&api=v2
29 .. _Login: http://testresults.opnfv.org/grafana/login
30
31 As shown in Framework_, there are two ways to store Storperf test results
32 into community's InfluxDB:
33
34 1. Yardstick executes Storperf test case (TC074), posting test job to Storperf
35    container via ReST API. After the test job is completed, Yardstick reads
36    test results via ReST API from Storperf and posts test data to the influxDB.
37
38 2. Additionally, Storperf can run tests by itself and post the test result
39    directly to the InfluxDB. The method for posting data directly to influxDB
40    will be supported in the future.
41
42 Our plan is to support rest-api in D release so that other testing projects can
43 call the rest-api to use yardstick dispatcher service to push data to
44 Yardstick's InfluxDB database.
45
46 For now, InfluxDB only supports line protocol, and the json protocol is
47 deprecated.
48
49 Take ping test case for example, the ``raw_result`` is json format like this:
50 ::
51
52     "benchmark": {
53         "timestamp": 1470315409.868095,
54         "errors": "",
55         "data": {
56           "rtt": {
57           "ares": 1.125
58           }
59         },
60       "sequence": 1
61       },
62     "runner_id": 2625
63   }
64
65 With the help of "influxdb_line_protocol", the json is transform to like below
66 as a line string::
67
68   'ping,deploy_scenario=unknown,host=athena.demo,installer=unknown,pod_name=unknown,
69     runner_id=2625,scenarios=Ping,target=ares.demo,task_id=77755f38-1f6a-4667-a7f3-
70       301c99963656,version=unknown rtt.ares=1.125 1470315409868094976'
71
72 So, for data output of json format, you just need to transform json into line
73 format and call influxdb api to post the data into the database. All this
74 function has been implemented in Influxdb_. If you need support on this, please
75 contact Mingjiang_.
76 ::
77
78   curl -i -XPOST 'http://104.197.68.199:8086/write?db=yardstick' --
79     data-binary 'ping,deploy_scenario=unknown,host=athena.demo,installer=unknown, ...'
80
81 Grafana will be used for visualizing the collected test data, which is shown in
82 Visual_. Grafana can be accessed by Login_.
83
84
85 .. image:: images/results_visualization.png
86    :width: 800px
87    :alt: results visualization
88