blob: 3476ec4831d0d3b2886091ab1814fd21fcdccae1 [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.. _apex-s3p-label:
6
7.. toctree::
8 :maxdepth: 2
9
10Policy APEX PDP component
11~~~~~~~~~~~~~~~~~~~~~~~~~
12
13Setting up Stability Tests in APEX
14++++++++++++++++++++++++++++++++++
15
16Introduction
17------------
18
19The 72 hour Stability Test for apex-pdp has the goal of introducing a steady flow of transactions initiated from a test client server running JMeter. The pdp is configured to start a rest server inside it and take input from rest clients (JMeter) and send back output to the rest clients (JMeter).
20
21The input events will be submitted through rest interface of apex-pdp and the results are verified using the rest responses coming out from apex-pdp.
22
23The test will be performed in a multi-threaded environment where 20 threads running in JMeter will keep sending events to apex-pdp in every 500 milliseconds for the duration of 72 hours.
24
25Setup details
26-------------
27
28The stability test is performed on VM's running in OpenStack cloud environment. There are 2 seperate VM's, one for running apex pdp & other one for running JMeter to simulate steady flow of transactions.
29
Pamela Dragoshba45dc62020-04-16 09:27:44 -040030
31Install & Configure VisualVM
32----------------------------
33
34VisualVM needs to be installed in the virtual machine having apex-pdp. It will be used to monitor CPU, Memory, GC for apex-pdp while stability test is running.
35
36Install visualVM
37
38.. code-block:: bash
39
40 sudo apt-get install visualvm
41
Pamela Dragoshba45dc62020-04-16 09:27:44 -040042Login to VM using graphical interface in separate terminal window.
43
44.. code-block:: bash
45
46 ssh -X <user>@<VM-IP-ADDRESS>
47
48Open visualVM
49
50.. code-block:: bash
51
52 visualvm &
Pamela Dragoshba45dc62020-04-16 09:27:44 -040053
huaxingd51d9062020-05-20 15:21:53 +080054Connect to apex-pdp JVM's JMX agent
551. Right click on "Local" in the left panel of the screen and select "Add Local JMX Connection..."
562. Enter localhost:9911 for "Connection", and click OK
573. Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC.
Pamela Dragoshba45dc62020-04-16 09:27:44 -040058
59Sample Screenshot of visualVM
60
huaxingd51d9062020-05-20 15:21:53 +080061.. image:: images/stability-visualvm1.PNG
62.. image:: images/stability-visualvm2.PNG
Pamela Dragoshba45dc62020-04-16 09:27:44 -040063
64Test Plan
65---------
66
waynedunican9a10ba32020-10-27 16:23:47 +000067The 72 hours stability test will run the following steps in 5 threaded loop.
Pamela Dragoshba45dc62020-04-16 09:27:44 -040068
69- **Send Input Event** - sends an input message to rest interface of apex-pdp.
70- **Assert Response Code** - assert the response code coming from apex-pdp.
71- **Assert Response Message** - assert the response message coming from apex-pdp.
72
73The following steps can be used to configure the parameters of test plan.
74
75- **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
76- **HTTP Request Defaults** - used to store HTTP request details like Server Name or IP, Port, Protocol etc.
77- **User Defined Variables** - used to store following user defined parameters.
78
79================== ============================================================================ ============================
80**Name** **Description** **Default Value**
81================== ============================================================================ ============================
82wait Wait time after each request (in milliseconds) 500
waynedunican9a10ba32020-10-27 16:23:47 +000083threads Number of threads to run test cases in parallel. 5
Pamela Dragoshba45dc62020-04-16 09:27:44 -040084threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 5000
85================== ============================================================================ ============================
86
87
88Download and update the jmx file presented in the apex-pdp git repository - `jmx file path <https://gerrit.onap.org/r/gitweb?p=policy/apex-pdp.git;a=tree;f=testsuites/apex-pdp-stability/src/main/resources;h=99d373033a190a690d4e05012bc3a656cae7bc3f;hb=refs/heads/master>`_.
89
90- HTTPSampler.domain - The ip address of VM which the apex container is running
91- HTTPSampler.port - The listening port, here is 23324
92- ThreadGroup.druation - Set the duration to 72 hours (in seconds)
93
94Use the CLI mode to start the test
95
96.. code-block:: bash
97
98 ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log
99
100Stability Test Result
101---------------------
102
103**Summary**
104
waynedunican9a10ba32020-10-27 16:23:47 +0000105Stability test plan was triggered for 72 hours injecting input events to apex-pdp from 5 client threads.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400106
waynedunican9a10ba32020-10-27 16:23:47 +0000107Once the test has complete - we can generate a HTML test report via the following command
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400108
109.. code-block:: bash
110
huaxingd51d9062020-05-20 15:21:53 +0800111 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400112
waynedunican9a10ba32020-10-27 16:23:47 +0000113============================================== ================================ ============= ============ ============================
114**Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request**
115============================================== ================================ ============= ============ ============================
arkadiusz.adamski32bad8e2021-03-31 09:26:46 +01001165 129326 100% 0% 6716.12
waynedunican9a10ba32020-10-27 16:23:47 +0000117============================================== ================================ ============= ============ ============================
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400118
huaxingd51d9062020-05-20 15:21:53 +0800119.. image:: images/stability-jmeter.PNG
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400120
arkadiusz.adamski32bad8e2021-03-31 09:26:46 +0100121download:`result.zip <apex-s3p-results/apex_s3p_results.zip>`
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400122
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100123
waynedunican9a10ba32020-10-27 16:23:47 +0000124Stability Test of Apex PDP
125^^^^^^^^^^^^^^^^^^^^^^^^^^
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100126
127The 72 hour Stability Test for apex-pdp has the goal of introducing a steady flow of transactions using jMeter.
128
129The input event will be submitted through the rest interface of DMaaP , which then triggers a grpc request to CDS. Based on the response, another DMaaP event is triggered.
130
131This test will be performed in an OOM deployment setup. The test will be performed in a multi-threaded environment where 5 threads running in JMeter will keep sending events for the duration of 72 hours.
132
waynedunican9a10ba32020-10-27 16:23:47 +0000133Test Plan
134---------
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100135
136The 72 hours stability test will run the following steps in a 5 threaded loop.
137
138- **Create Policy** - creates a policy using the policy/api component
139- **Deploy Policy** - deploys the policy in the existing PdpGroup
140- **Check Health** - checks the health status of apex
141- **Send Input Event** - trigger 'unauthenticated.DCAE_CL_OUTPUT' event of DMaaP.
142- **Get Output Event Response** - check for the triggered output event.
143- **Undeploy Policy** - undeploys the policy from PdpGroup
144- **Delete Policy** - deletes the policy using the policy/api component
145
146The following steps can be used to configure the parameters of the test plan.
147
148- **HTTP Header Manager** - used to store headers which will be used for making HTTP requests.
149- **HTTP Request Defaults** - used to store HTTP request details like Server Name or IP, Port, Protocol etc.
150- **User Defined Variables** - used to store the following user defined parameters:
151
152================== ============================================================================ ============================
153**Name** **Description** **Default Value**
154================== ============================================================================ ============================
155wait Wait time after each request (in milliseconds) 120000
156threads Number of threads to run test cases in parallel. 5
157threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 150000
waynedunican9a10ba32020-10-27 16:23:47 +0000158PAP_PORT Port number of PAP for making REST API calls
159API_PORT Port number of API for making REST API calls
160APEX_PORT Port number of APEX for making REST API calls
161DMAAP_PORT Port number of DMAAP for making REST API calls
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100162================== ============================================================================ ============================
163
164
165Download and update the jmx file presented in the apex-pdp git repository - `jmx file path <https://gerrit.onap.org/r/gitweb?p=policy/apex-pdp.git;a=tree;f=testsuites/apex-pdp-stability/src/main/resources;h=99d373033a190a690d4e05012bc3a656cae7bc3f;hb=refs/heads/master>`_.
166
167- HTTPSampler.domain - The ip address of the VM in which the apex container is running
168- HTTPSampler.port - The listening port, here is 23324
waynedunican9a10ba32020-10-27 16:23:47 +0000169- ThreadGroup.duration - Set the duration to 72 hours (in seconds)
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100170
171Use the CLI mode to start the test
172
173.. code-block:: bash
174
waynedunican9a10ba32020-10-27 16:23:47 +0000175 nohup ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100176
177
waynedunican9a10ba32020-10-27 16:23:47 +0000178Stability Test Results
179----------------------
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100180
waynedunican9a10ba32020-10-27 16:23:47 +0000181The stability test plan was triggered for 72 hours, injecting input events to apex-pdp pod from 5 client threads running in JMeter.
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100182
waynedunican9a10ba32020-10-27 16:23:47 +0000183The stability tests were executed as part of a full ONAP OOM deployment in Nordix lab.
184
185Once the tests complete, we can generate an HTML test report via the command:
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100186
187.. code-block:: bash
188
189 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/
190
waynedunican9a10ba32020-10-27 16:23:47 +0000191============================================== ================================ ============= ============ ============================
192**Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request**
193============================================== ================================ ============= ============ ============================
arkadiusz.adamski32bad8e2021-03-31 09:26:46 +01001945 129326 100% 0% 6716.12
waynedunican9a10ba32020-10-27 16:23:47 +0000195============================================== ================================ ============= ============ ============================
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100196
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100197
198**JMeter Screenshot**
199
waynedunican9a10ba32020-10-27 16:23:47 +0000200.. image:: images/apex_s3p_jm-1.png
201.. image:: images/apex_s3p_jm-2.png
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100202
arkadiusz.adamski32bad8e2021-03-31 09:26:46 +0100203download:`result.zip <apex-s3p-results/apex_s3p_results.zip>`
aditya.puthuparambil9d4e96e2020-06-02 12:10:24 +0100204
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400205Setting up Performance Tests in APEX
206++++++++++++++++++++++++++++++++++++
207
waynedunican9a10ba32020-10-27 16:23:47 +0000208The Performance test is performed on a similar setup to the Stability test. JMeter will send a large number of REST requests and will then retrieve those requests.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400209
arkadiusz.adamski32bad8e2021-03-31 09:26:46 +0100210Performance test plan will be the same as the stability test plan except for some differences listed below:
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400211
waynedunican9a10ba32020-10-27 16:23:47 +0000212- Increase the number of threads from 5 to 60.
213- Reduce test time to ninety minutes.
214- Calculate the amount of requests handled in the time frame.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400215
waynedunican9a10ba32020-10-27 16:23:47 +0000216Run Test
217--------
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400218
waynedunican9a10ba32020-10-27 16:23:47 +0000219Running the performance test will be the same as the stability test. That is, launch JMeter pointing to corresponding *.jmx* test plan. The *API_HOST* , *API_PORT* , *PAP_HOST* , *PAP_PORT* are already set up in *.jmx*.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400220
221.. code-block:: bash
222
waynedunican9a10ba32020-10-27 16:23:47 +0000223 nohup ./jmeter.sh -n -t ~/performance.jmx -Jusers=1 -l ~/perf.log
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400224
waynedunican9a10ba32020-10-27 16:23:47 +0000225Once the tests have completed, run the following the gather results.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400226
227.. code-block:: bash
228
waynedunican9a10ba32020-10-27 16:23:47 +0000229 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g perf.log -o ./performance_result/
huaxingd51d9062020-05-20 15:21:53 +0800230
waynedunican9a10ba32020-10-27 16:23:47 +0000231Performance Test Result
232-----------------------
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400233
234**Summary**
235
waynedunican9a10ba32020-10-27 16:23:47 +0000236Performance test was triggered for 90 minutes. The results are shown below.
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400237
238**Test Statistics**
239
waynedunican9a10ba32020-10-27 16:23:47 +0000240============================ =========== ========= ==================================
241**Total Number of Requests** **Success** **Error** **Average Time Taken per Request**
242============================ =========== ========= ==================================
2439870 100 % 0 % 5506.09 ms
244============================ =========== ========= ==================================
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400245
waynedunican9a10ba32020-10-27 16:23:47 +0000246**JMeter Screenshot**
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400247
waynedunican9a10ba32020-10-27 16:23:47 +0000248.. image:: images/apex_perf_jm_1.png
Pamela Dragoshba45dc62020-04-16 09:27:44 -0400249
waynedunican9a10ba32020-10-27 16:23:47 +0000250.. image:: images/apex_perf_jm_2.png