55867b44745c4024959aac43e0cf0230bb2ecba4
[policy/parent.git] / docs / development / devtools / api-s3p.rst
1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
4
5 .. _api-s3p-label:
6
7 .. toctree::
8    :maxdepth: 2
9
10 Policy API S3P Tests
11 ####################
12
13
14 72 Hours Stability Test of Policy API
15 +++++++++++++++++++++++++++++++++++++
16
17 Introduction
18 ------------
19
20 The 72 hour stability test of policy API has the goal of verifying the stability of running policy design API REST
21 service by ingesting a steady flow of transactions in a multi-threaded fashion to
22 simulate multiple clients' behaviors.
23 All the transaction flows are initiated from a test client server running JMeter for the duration of 72 hours.
24
25 Setup Details
26 -------------
27
28 The stability test was performed on a default ONAP OOM installation in the Intel Wind River Lab environment.
29 JMeter was installed on a separate VM to inject the traffic defined in the
30 `API stability script
31 <https://git.onap.org/policy/api/tree/testsuites/stability/src/main/resources/testplans/policy_api_stability.jmx>`_
32 with the following command:
33
34 .. code-block:: bash
35
36     jmeter.sh --nongui --testfile policy_api_stability.jmx --logfile result.jtl
37
38
39 Test Plan
40 ---------
41
42 The 72+ hours stability test will be running the following steps sequentially
43 in multi-threaded loops. Thread number is set to 5 to simulate 5 API clients'
44 behaviors (they can be calling the same policy CRUD API simultaneously).
45 Each thread creates a different version of the policy types and policies to not
46 interfere with one another while operating simultaneously.  The point version
47 of each entity is set to the running thread number.
48
49 **Setup Thread (will be running only once)**
50
51 - Get policy-api Healthcheck
52 - Get API Counter Statistics
53 - Get Preloaded Policy Types
54
55 **API Test Flow (5 threads running the same steps in the same loop)**
56
57 - Create a new Monitoring Policy Type with Version 6.0.#
58 - Create a new Monitoring Policy Type with Version 7.0.#
59 - Create a new Optimization Policy Type with Version 6.0.#
60 - Create a new Guard Policy Type with Version 6.0.#
61 - Create a new Native APEX Policy Type with Version 6.0.#
62 - Create a new Native Drools Policy Type with Version 6.0.#
63 - Create a new Native XACML Policy Type with Version 6.0.#
64 - Get All Policy Types
65 - Get All Versions of the new Monitoring Policy Type
66 - Get Version 6.0.# of the new Monitoring Policy Type
67 - Get Version 6.0.# of the new Optimzation Policy Type
68 - Get Version 6.0.# of the new Guard Policy Type
69 - Get Version 6.0.# of the new Native APEX Policy Type
70 - Get Version 6.0.# of the new Native Drools Policy Type
71 - Get Version 6.0.# of the new Native XACML Policy Type
72 - Get the Latest Version of the New Monitoring Policy Type
73 - Create Monitoring Policy Ver 6.0.# w/Monitoring Policy Type Ver 6.0.#
74 - Create Monitoring Policy Ver 7.0.# w/Monitoring Policy Type Ver 7.0.#
75 - Create Optimization Policy Ver 6.0.# w/Optimization Policy Type Ver 6.0.#
76 - Create Guard Policy Ver 6.0.# w/Guard Policy Type Ver 6.0.#
77 - Create Native APEX Policy Ver 6.0.# w/Native APEX Policy Type Ver 6.0.#
78 - Create Native Drools Policy Ver 6.0.# w/Native Drools Policy Type Ver 6.0.#
79 - Create Native XACML Policy Ver 6.0.# w/Native XACML Policy Type Ver 6.0.#
80 - Get Version 6.0.# of the new Monitoring Policy
81 - Get Version 6.0.# of the new Optimzation Policy
82 - Get Version 6.0.# of the new Guard Policy
83 - Get Version 6.0.# of the new Native APEX Policy
84 - Get Version 6.0.# of the new Native Drools Policy
85 - Get Version 6.0.# of the new Native XACML Policy
86 - Get the Latest Version of the new Monitoring Policy
87 - Delete Version 6.0.# of the new Monitoring Policy
88 - Delete Version 7.0.# of the new Monitoring Policy
89 - Delete Version 6.0.# of the new Optimzation Policy
90 - Delete Version 6.0.# of the new Guard Policy
91 - Delete Version 6.0.# of the new Native APEX Policy
92 - Delete Version 6.0.# of the new Native Drools Policy
93 - Delete Version 6.0.# of the new Native XACML Policy
94 - Delete Monitoring Policy Type with Version 6.0.#
95 - Delete Monitoring Policy Type with Version 7.0.#
96 - Delete Optimization Policy Type with Version 6.0.#
97 - Delete Guard Policy Type with Version 6.0.#
98 - Delete Native APEX Policy Type with Version 6.0.#
99 - Delete Native Drools Policy Type with Version 6.0.#
100 - Delete Native XACML Policy Type with Version 6.0.#
101
102 **TearDown Thread (will only be running after API Test Flow is completed)**
103
104 - Get policy-api Healthcheck
105 - Get Preloaded Policy Types
106
107
108 Test Results
109 ------------
110
111 **Summary**
112
113 No errors were found during the 72 hours of the Policy API stability run.
114 The load was performed against a non-tweaked ONAP OOM installation.
115
116 **Test Statistics**
117
118 =======================  =============  ===========  ===============================  ===============================  ===============================
119 **Total # of requests**  **Success %**    **TPS**    **Avg. time taken per request**  **Min. time taken per request**  **Max. time taken per request**
120 =======================  =============  ===========  ===============================  ===============================  ===============================
121     627746                    100%         2.42              2058 ms                               26 ms                          72809 ms
122 =======================  =============  ===========  ===============================  ===============================  ===============================
123
124 .. image:: images/api-s3p-jm-1_H.png
125
126 **JMeter Results**
127
128 The following graphs show the response time distributions.   The "Get Policy Types" API calls are the most expensive calls that
129 average a 10 seconds plus response time.
130
131 .. image:: images/api-response-time-distribution_H.png
132 .. image:: images/api-response-time-overtime_H.png
133
134
135 Performance Test of Policy API
136 ++++++++++++++++++++++++++++++
137
138 Introduction
139 ------------
140
141 Performance test of policy-api has the goal of testing the min/avg/max processing time and rest call throughput for all the requests when the number of requests are large enough to saturate the resource and find the bottleneck.
142
143 Setup Details
144 -------------
145
146 The performance test was performed on a default ONAP OOM installation in the Intel Wind River Lab environment.
147 JMeter was installed on a separate VM to inject the traffic defined in the
148 `API performace script
149 <https://git.onap.org/policy/api/tree/testsuites/performance/src/main/resources/testplans/policy_api_performance.jmx>`_
150 with the following command:
151
152 .. code-block:: bash
153
154     jmeter.sh --nongui --testfile policy_api_performance.jmx --logfile result.jtl
155
156
157 Test Plan
158 ---------
159
160 Performance test plan is the same as stability test plan above.
161 Only differences are, in performance test, we increase the number of threads up to 20 (simulating 20 users' behaviors at the same time) whereas reducing the test time down to 2.5 hours.
162
163 Run Test
164 --------
165
166 Running/Triggering performance test will be the same as stability test. That is, launch JMeter pointing to corresponding *.jmx* test plan. The *API_HOST* and *API_PORT* are already set up in *.jmx*.
167
168 **Test Statistics**
169
170 =======================  =============  ===========  ===============================  ===============================  ===============================
171 **Total # of requests**  **Success %**    **TPS**    **Avg. time taken per request**  **Min. time taken per request**  **Max. time taken per request**
172 =======================  =============  ===========  ===============================  ===============================  ===============================
173     4082                     100%           0.45              1297 ms                              4 ms                          63612 ms
174 =======================  =============  ===========  ===============================  ===============================  ===============================
175
176 .. image:: images/api-s3p-jm-2_H.png
177
178 Test Results
179 ------------
180
181 The following graphs show the response time distributions.
182
183 .. image:: images/api-response-time-distribution_performance_H.png
184 .. image:: images/api-response-time-overtime_performance_H.png
185
186
187
188