blob: 12c3a51660d0637f67b610d9109be8a30f0b9116 [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
lapentafd45ce6552022-04-12 11:23:22 +010022simulate multiple clients' behaviours.
jhha4ff7b82020-10-23 09:15:35 -050023All 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
lapentafdcc1c4362022-10-24 15:25:21 +010028The stability test was performed on a default ONAP OOM installation in the Nordix Lab environment.
jhha4ff7b82020-10-23 09:15:35 -050029JMeter 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
lapentafdcc1c4362022-10-24 15:25:21 +010036 nohup apache-jmeter-5.5/bin/jmeter -n -t policy_api_stability.jmx -l stabilityTestResultsPolicyApi.jtl &
Pamela Dragoshba45dc62020-04-16 09:27:44 -040037
lapentafdcc1c4362022-10-24 15:25:21 +010038The test was run in the background via “nohup” and “&”, to prevent it from being interrupted.
Pamela Dragoshba45dc62020-04-16 09:27:44 -040039
Chris Ramstad6fca6792020-05-19 12:35:57 -070040Test Plan
41---------
Pamela Dragoshba45dc62020-04-16 09:27:44 -040042
Chris Ramstad6fca6792020-05-19 12:35:57 -070043The 72+ hours stability test will be running the following steps sequentially
44in multi-threaded loops. Thread number is set to 5 to simulate 5 API clients'
lapentafd45ce6552022-04-12 11:23:22 +010045behaviours (they can be calling the same policy CRUD API simultaneously).
Chris Ramstad6fca6792020-05-19 12:35:57 -070046Each thread creates a different version of the policy types and policies to not
47interfere with one another while operating simultaneously. The point version
48of each entity is set to the running thread number.
49
50**Setup Thread (will be running only once)**
51
52- Get policy-api Healthcheck
53- Get API Counter Statistics
54- Get Preloaded Policy Types
55
56**API Test Flow (5 threads running the same steps in the same loop)**
57
58- Create a new Monitoring Policy Type with Version 6.0.#
59- Create a new Monitoring Policy Type with Version 7.0.#
60- Create a new Optimization Policy Type with Version 6.0.#
61- Create a new Guard Policy Type with Version 6.0.#
62- Create a new Native APEX Policy Type with Version 6.0.#
63- Create a new Native Drools Policy Type with Version 6.0.#
64- Create a new Native XACML Policy Type with Version 6.0.#
65- Get All Policy Types
66- Get All Versions of the new Monitoring Policy Type
67- Get Version 6.0.# of the new Monitoring Policy Type
lapentafd45ce6552022-04-12 11:23:22 +010068- Get Version 6.0.# of the new Optimization Policy Type
Chris Ramstad6fca6792020-05-19 12:35:57 -070069- Get Version 6.0.# of the new Guard Policy Type
70- Get Version 6.0.# of the new Native APEX Policy Type
71- Get Version 6.0.# of the new Native Drools Policy Type
72- Get Version 6.0.# of the new Native XACML Policy Type
73- Get the Latest Version of the New Monitoring Policy Type
Prakhar Pandey81b980c2022-04-14 02:49:29 -040074- Create Version 6.0.# of Node Template
Chris Ramstad6fca6792020-05-19 12:35:57 -070075- Create Monitoring Policy Ver 6.0.# w/Monitoring Policy Type Ver 6.0.#
76- Create Monitoring Policy Ver 7.0.# w/Monitoring Policy Type Ver 7.0.#
77- Create Optimization Policy Ver 6.0.# w/Optimization Policy Type Ver 6.0.#
78- Create Guard Policy Ver 6.0.# w/Guard Policy Type Ver 6.0.#
79- Create Native APEX Policy Ver 6.0.# w/Native APEX Policy Type Ver 6.0.#
80- Create Native Drools Policy Ver 6.0.# w/Native Drools Policy Type Ver 6.0.#
81- Create Native XACML Policy Ver 6.0.# w/Native XACML Policy Type Ver 6.0.#
Prakhar Pandey81b980c2022-04-14 02:49:29 -040082- Create Version 6.0.# of PNF Example Policy with Metadata
83- Get Node Template
84- Get All TCA Policies
85- Get All Versions of Monitoring Policy Type
Chris Ramstad6fca6792020-05-19 12:35:57 -070086- Get Version 6.0.# of the new Monitoring Policy
lapentafd45ce6552022-04-12 11:23:22 +010087- Get Version 6.0.# of the new Optimization Policy
Chris Ramstad6fca6792020-05-19 12:35:57 -070088- Get Version 6.0.# of the new Guard Policy
89- Get Version 6.0.# of the new Native APEX Policy
90- Get Version 6.0.# of the new Native Drools Policy
91- Get Version 6.0.# of the new Native XACML Policy
92- Get the Latest Version of the new Monitoring Policy
93- Delete Version 6.0.# of the new Monitoring Policy
94- Delete Version 7.0.# of the new Monitoring Policy
lapentafd45ce6552022-04-12 11:23:22 +010095- Delete Version 6.0.# of the new OptimizationPolicy
Chris Ramstad6fca6792020-05-19 12:35:57 -070096- Delete Version 6.0.# of the new Guard Policy
97- Delete Version 6.0.# of the new Native APEX Policy
Prakhar Pandey81b980c2022-04-14 02:49:29 -040098- Delete Version 6.0.# of PNF Example Policy having Metadata
Chris Ramstad6fca6792020-05-19 12:35:57 -070099- Delete Version 6.0.# of the new Native Drools Policy
100- Delete Version 6.0.# of the new Native XACML Policy
101- Delete Monitoring Policy Type with Version 6.0.#
102- Delete Monitoring Policy Type with Version 7.0.#
103- Delete Optimization Policy Type with Version 6.0.#
104- Delete Guard Policy Type with Version 6.0.#
105- Delete Native APEX Policy Type with Version 6.0.#
106- Delete Native Drools Policy Type with Version 6.0.#
107- Delete Native XACML Policy Type with Version 6.0.#
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400108- Delete Node Template
109- Get Policy Metrics
Chris Ramstad6fca6792020-05-19 12:35:57 -0700110
111**TearDown Thread (will only be running after API Test Flow is completed)**
112
113- Get policy-api Healthcheck
114- Get Preloaded Policy Types
115
116
jhha4ff7b82020-10-23 09:15:35 -0500117Test Results
118------------
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400119
120**Summary**
121
jhha4ff7b82020-10-23 09:15:35 -0500122No errors were found during the 72 hours of the Policy API stability run.
123The load was performed against a non-tweaked ONAP OOM installation.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400124
125**Test Statistics**
126
127======================= ============= =========== =============================== =============================== ===============================
jhha4ff7b82020-10-23 09:15:35 -0500128**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 -0400129======================= ============= =========== =============================== =============================== ===============================
lapentafdcc1c4362022-10-24 15:25:21 +0100130 950839 100% 3.67 1351 ms 126 ms 16324 ms
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400131======================= ============= =========== =============================== =============================== ===============================
132
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400133.. image:: api-s3p-results/api-s3p-jm-1_J.png
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400134
135**JMeter Results**
136
jhhab948fc2020-10-23 17:30:34 -0500137The following graphs show the response time distributions. The "Get Policy Types" API calls are the most expensive calls that
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400138average a 13 seconds plus response time.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400139
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400140.. image:: api-s3p-results/api-response-time-distribution_J.png
141.. image:: api-s3p-results/api-response-time-overtime_J.png
a.sreekumar67538f52021-10-18 10:21:06 +0100142
143**Memory and CPU usage**
144
145The memory and CPU usage can be monitored by running "top" command in the policy-api pod.
146A snapshot is taken before and after test execution to monitor the changes in resource utilization.
147
148Memory and CPU usage before test execution:
149
lapentafdcc1c4362022-10-24 15:25:21 +0100150.. image:: api-s3p-results/api_top_before_72h.png
a.sreekumar67538f52021-10-18 10:21:06 +0100151
152Memory and CPU usage after test execution:
153
lapentafdcc1c4362022-10-24 15:25:21 +0100154.. image:: api-s3p-results/api_top_after_72h.png
Chris Ramstad6fca6792020-05-19 12:35:57 -0700155
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400156
157Performance Test of Policy API
158++++++++++++++++++++++++++++++
159
lapentafd01f67422021-03-30 15:18:12 +0100160Introduction
161------------
162
163Performance 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.
164
165Setup Details
166-------------
167
lapentafdcc1c4362022-10-24 15:25:21 +0100168The performance test was performed on a default ONAP OOM installation in the Nordix Lab environment.
lapentafd01f67422021-03-30 15:18:12 +0100169JMeter was installed on a separate VM to inject the traffic defined in the
lapentafd45ce6552022-04-12 11:23:22 +0100170`API performance script
lapentafd01f67422021-03-30 15:18:12 +0100171<https://git.onap.org/policy/api/tree/testsuites/performance/src/main/resources/testplans/policy_api_performance.jmx>`_
172with the following command:
173
174.. code-block:: bash
175
lapentafdcc1c4362022-10-24 15:25:21 +0100176 nohup apache-jmeter-5.5/bin/jmeter -n -t policy_api_performance.jmx -l performanceTestResultsPolicyApi.jtl &
lapentafd01f67422021-03-30 15:18:12 +0100177
lapentafdcc1c4362022-10-24 15:25:21 +0100178The test was run in the background via nohup and “&”, to prevent it from being interrupted.
lapentafd01f67422021-03-30 15:18:12 +0100179
180Test Plan
181---------
182
183Performance test plan is the same as stability test plan above.
lapentafd45ce6552022-04-12 11:23:22 +0100184Only differences are, in performance test, we increase the number of threads up to 20 (simulating 20 users' behaviours at the same time) whereas reducing the test time down to 2.5 hours.
lapentafd01f67422021-03-30 15:18:12 +0100185
186Run Test
187--------
188
189Running/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*.
190
191**Test Statistics**
192
193======================= ============= =========== =============================== =============================== ===============================
194**Total # of requests** **Success %** **TPS** **Avg. time taken per request** **Min. time taken per request** **Max. time taken per request**
195======================= ============= =========== =============================== =============================== ===============================
lapentafdcc1c4362022-10-24 15:25:21 +0100196 16212 100% 1.8 11109 ms 162 ms 237265 ms
lapentafd01f67422021-03-30 15:18:12 +0100197======================= ============= =========== =============================== =============================== ===============================
198
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400199.. image:: api-s3p-results/api-s3p-jm-2_J.png
lapentafd01f67422021-03-30 15:18:12 +0100200
201Test Results
202------------
203
204The following graphs show the response time distributions.
205
Prakhar Pandey81b980c2022-04-14 02:49:29 -0400206.. image:: api-s3p-results/api-response-time-distribution_performance_J.png
207.. image:: api-s3p-results/api-response-time-overtime_performance_J.png
lapentafd01f67422021-03-30 15:18:12 +0100208
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400209
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400210
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400211