1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
10 Policy APEX PDP component
11 ~~~~~~~~~~~~~~~~~~~~~~~~~
13 Setting up Stability Tests in APEX
14 ++++++++++++++++++++++++++++++++++
19 The 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).
21 The 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.
23 The 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.
28 The 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.
31 Install & Configure VisualVM
32 ----------------------------
34 VisualVM 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.
40 sudo apt-get install visualvm
42 Login to VM using graphical interface in separate terminal window.
46 ssh -X <user>@<VM-IP-ADDRESS>
54 Connect to apex-pdp JVM's JMX agent
55 1. Right click on "Local" in the left panel of the screen and select "Add Local JMX Connection..."
56 2. Enter localhost:9911 for "Connection", and click OK
57 3. Double click on the newly added nodes under "Local" to start monitoring CPU, Memory & GC.
59 Sample Screenshot of visualVM
61 .. image:: images/stability-visualvm1.PNG
62 .. image:: images/stability-visualvm2.PNG
67 The 72 hours stability test will run the following steps in 5 threaded loop.
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.
73 The following steps can be used to configure the parameters of test plan.
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.
79 ================== ============================================================================ ============================
80 **Name** **Description** **Default Value**
81 ================== ============================================================================ ============================
82 wait Wait time after each request (in milliseconds) 500
83 threads Number of threads to run test cases in parallel. 5
84 threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 5000
85 ================== ============================================================================ ============================
88 Download 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>`_.
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)
94 Use the CLI mode to start the test
98 ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log
100 Stability Test Result
101 ---------------------
105 Stability test plan was triggered for 72 hours injecting input events to apex-pdp from 5 client threads.
107 Once the test has complete - we can generate a HTML test report via the following command
111 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/
113 ============================================== ================================ ============= ============ ============================
114 **Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request**
115 ============================================== ================================ ============= ============ ============================
116 5 8594220 100% 0% 5518.73
117 ============================================== ================================ ============= ============ ============================
119 .. image:: images/stability-jmeter.PNG
121 :download:`result.zip <apex-s3p-results/apex_s3p_results.zip>`
124 Stability Test of Apex PDP
125 ^^^^^^^^^^^^^^^^^^^^^^^^^^
127 The 72 hour Stability Test for apex-pdp has the goal of introducing a steady flow of transactions using jMeter.
129 The 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.
131 This 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.
136 The 72 hours stability test will run the following steps in a 5 threaded loop.
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
146 The following steps can be used to configure the parameters of the test plan.
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:
152 ================== ============================================================================ ============================
153 **Name** **Description** **Default Value**
154 ================== ============================================================================ ============================
155 wait Wait time after each request (in milliseconds) 120000
156 threads Number of threads to run test cases in parallel. 5
157 threadsTimeOutInMs Synchronization timer for threads running in parallel (in milliseconds). 150000
158 PAP_PORT Port number of PAP for making REST API calls
159 API_PORT Port number of API for making REST API calls
160 APEX_PORT Port number of APEX for making REST API calls
161 DMAAP_PORT Port number of DMAAP for making REST API calls
162 ================== ============================================================================ ============================
165 Download 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>`_.
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
169 - ThreadGroup.duration - Set the duration to 72 hours (in seconds)
171 Use the CLI mode to start the test
175 nohup ./jmeter.sh -n -t ~/apexPdpStabilityTestPlan.jmx -Jusers=1 -l ~/stability.log
178 Stability Test Results
179 ----------------------
181 The stability test plan was triggered for 72 hours, injecting input events to apex-pdp pod from 5 client threads running in JMeter.
183 The stability tests were executed as part of a full ONAP OOM deployment in Nordix lab.
185 Once the tests complete, we can generate an HTML test report via the command:
189 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g stability.log -o ./result/
191 ============================================== ================================ ============= ============ ============================
192 **Number of Client Threads running in JMeter** **Total number of input events** **Success %** **Error %** **Average Time per Request**
193 ============================================== ================================ ============= ============ ============================
194 5 8594220 100% 0% 5518.73
195 ============================================== ================================ ============= ============ ============================
198 **JMeter Screenshot**
200 .. image:: images/apex_s3p_jm-1.png
201 .. image:: images/apex_s3p_jm-2.png
203 :download:`result.zip <apex-s3p-results/apex_s3p_results.zip>`
205 Setting up Performance Tests in APEX
206 ++++++++++++++++++++++++++++++++++++
208 The 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.
210 Performnce test plan will be the same as the stability test plan except for some differences listed below:
212 - 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.
219 Running 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*.
223 nohup ./jmeter.sh -n -t ~/performance.jmx -Jusers=1 -l ~/perf.log
225 Once the tests have completed, run the following the gather results.
229 ~/jMeter/apache-jmeter-5.2.1/bin/jmeter -g perf.log -o ./performance_result/
231 Performance Test Result
232 -----------------------
236 Performance test was triggered for 90 minutes. The results are shown below.
240 ============================ =========== ========= ==================================
241 **Total Number of Requests** **Success** **Error** **Average Time Taken per Request**
242 ============================ =========== ========= ==================================
243 9870 100 % 0 % 5506.09 ms
244 ============================ =========== ========= ==================================
246 **JMeter Screenshot**
248 .. image:: images/apex_perf_jm_1.png
250 .. image:: images/apex_perf_jm_2.png