blob: 55867b44745c4024959aac43e0cf0230bb2ecba4 [file] [log] [blame]
Pamela Dragoshba45dc62020-04-16 09:27:44 -04001.. 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
10Policy API S3P Tests
11####################
12
13
1472 Hours Stability Test of Policy API
15+++++++++++++++++++++++++++++++++++++
16
17Introduction
18------------
19
jhha4ff7b82020-10-23 09:15:35 -050020The 72 hour stability test of policy API has the goal of verifying the stability of running policy design API REST
21service by ingesting a steady flow of transactions in a multi-threaded fashion to
22simulate multiple clients' behaviors.
23All the transaction flows are initiated from a test client server running JMeter for the duration of 72 hours.
Pamela Dragoshba45dc62020-04-16 09:27:44 -040024
25Setup Details
26-------------
27
jhha4ff7b82020-10-23 09:15:35 -050028The stability test was performed on a default ONAP OOM installation in the Intel Wind River Lab environment.
29JMeter 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>`_
32with the following command:
Pamela Dragoshba45dc62020-04-16 09:27:44 -040033
34.. code-block:: bash
Chris Ramstad6fca6792020-05-19 12:35:57 -070035
jhha4ff7b82020-10-23 09:15:35 -050036 jmeter.sh --nongui --testfile policy_api_stability.jmx --logfile result.jtl
Pamela Dragoshba45dc62020-04-16 09:27:44 -040037
Pamela Dragoshba45dc62020-04-16 09:27:44 -040038
Chris Ramstad6fca6792020-05-19 12:35:57 -070039Test Plan
40---------
Pamela Dragoshba45dc62020-04-16 09:27:44 -040041
Chris Ramstad6fca6792020-05-19 12:35:57 -070042The 72+ hours stability test will be running the following steps sequentially
43in multi-threaded loops. Thread number is set to 5 to simulate 5 API clients'
44behaviors (they can be calling the same policy CRUD API simultaneously).
45Each thread creates a different version of the policy types and policies to not
46interfere with one another while operating simultaneously. The point version
47of 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
jhha4ff7b82020-10-23 09:15:35 -0500108Test Results
109------------
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400110
111**Summary**
112
jhha4ff7b82020-10-23 09:15:35 -0500113No errors were found during the 72 hours of the Policy API stability run.
114The load was performed against a non-tweaked ONAP OOM installation.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400115
116**Test Statistics**
117
118======================= ============= =========== =============================== =============================== ===============================
jhha4ff7b82020-10-23 09:15:35 -0500119**Total # of requests** **Success %** **TPS** **Avg. time taken per request** **Min. time taken per request** **Max. time taken per request**
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400120======================= ============= =========== =============================== =============================== ===============================
lapentafd74d444b2021-03-29 11:29:00 +0100121 627746 100% 2.42 2058 ms 26 ms 72809 ms
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400122======================= ============= =========== =============================== =============================== ===============================
123
lapentafd74d444b2021-03-29 11:29:00 +0100124.. image:: images/api-s3p-jm-1_H.png
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400125
126**JMeter Results**
127
jhhab948fc2020-10-23 17:30:34 -0500128The following graphs show the response time distributions. The "Get Policy Types" API calls are the most expensive calls that
jhha4ff7b82020-10-23 09:15:35 -0500129average a 10 seconds plus response time.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400130
lapentafd74d444b2021-03-29 11:29:00 +0100131.. image:: images/api-response-time-distribution_H.png
132.. image:: images/api-response-time-overtime_H.png
Chris Ramstad6fca6792020-05-19 12:35:57 -0700133
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400134
135Performance Test of Policy API
136++++++++++++++++++++++++++++++
137
lapentafdfe1775c2021-03-30 15:18:12 +0100138Introduction
139------------
140
141Performance 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
143Setup Details
144-------------
145
146The performance test was performed on a default ONAP OOM installation in the Intel Wind River Lab environment.
147JMeter 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>`_
150with the following command:
151
152.. code-block:: bash
153
154 jmeter.sh --nongui --testfile policy_api_performance.jmx --logfile result.jtl
155
156
157Test Plan
158---------
159
160Performance test plan is the same as stability test plan above.
161Only 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
163Run Test
164--------
165
166Running/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
178Test Results
179------------
180
181The 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
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400186
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400187
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400188