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