All Products
Search
Document Center

Performance Testing:Debug a stress testing scenario

Last Updated:Nov 01, 2024

After you configure a stress testing scenario, you can debug the scenario to check whether the configurations of the scenario meet your business requirements. This can ensure the success of stress testing. This topic describes how to debug a Performance Testing (PTS) scenario and a JMeter scenario.

Prerequisites

A PTS scenario or JMeter scenario is created. For more information, see Create a PTS scenario or Create a JMeter scenario.

Procedure

  1. Log on to the PTS console and choose Performance Test > Scenarios.

  2. On the Scenarios page, find the desired stress testing scenario and click Edit in the Actions column to go to the Edit Scenario page. In the lower part of the Edit Scenario page, click Debug to debug the stress testing scenario.

    During the debugging process, you can click the 调试场景.png icon in the upper-right corner of the Debug dialog box to minimize the dialog box. This allows you to monitor the debugging process at any time in the pop-up window displayed in the lower-right corner of the Edit Scenario page. To maximize the Debug dialog box, you can click the pop-up window.

  3. View request logs of all links in the debugging result. To view the debugging information of a single API operation, click the API operation name.

    If you want to debug a single API operation, you can click Debug API to the right of the API operation name on the Scenario Settings tab. After the debugging is complete, you can view the debugging result.

    Important

    PTS does not support the debugging of a single API operation in a virtual private cloud (VPC). If you want to debug a single API operation in a VPC, you can click Debug in the lower part of the Edit Scenario page to debug the whole stress testing scenario.

Interface description for debugging a PTS scenario

The following figure shows the information that is displayed on the interface when you debug a PTS scenario.

image

  1. Assertion judgment

    The cross sign (×) indicates that a response exception occurred. You can click the API operation on which a response exception occurs and view the response details of the API operation on the right.

  2. Response status

    The keyword Status Exception or a status code such as 200, 302, 403, 503, or 500 may be displayed. If the keyword Status Exception is displayed, no response is returned because the request times out or the request URL that contains the request body is incorrect. The incorrectness may occur if the specified function cannot be identified or the URL format is invalid.

    Note

    You can view the request and response details of each API operation that is debugged. You can troubleshoot issues related to the response status based on the following instructions:

    • If Status Exception is displayed for the response status, you can view the exception information in the Error Information section of the Response Details tab on the right. For example, in the preceding figure, the cause of the exception is invalid parameters, which indicate that the system function is incorrectly used.

    • If a status code other than 200 is displayed for the response status, you can view the response information and troubleshoot the issue based on the logs on the related server.

    • If an exception occurs in the assertion, you can view the assertion information in the Checkpoint information section of the Response Details tab. If no assertion information is displayed, no output parameter values are obtained.

  3. Error information

    Details about abnormal responses are displayed, such as timeout information, parameter errors, and connection denial.

  4. Details about time consumption of requests in the core lifecycle on the Timing tab

    You can view the exception information that appears during the debugging process by using the timing waterfall model. All error messages can be presented in the timing waterfall model.

    For example, if you enable a 302 redirect when you configure a stress testing scenario, you can check whether a redirect is performed during stress testing and the path of the redirect in the timing waterfall.

  5. Entry point for testing an output parameter expressionimage

    If you want to extract a specific string based on the response details of the request, you can use a regular expression. To ensure that the string can be extracted, you can test whether the regular expression is correct when you debug the stress testing scenario. If the existing output parameters do not meet your business requirements, you can reconfigure output parameters based on your business requirements. In most cases, the string that you can extract based on the response details of a request is a TEXT-type response body.

    Note

    Parsing of the Application/JSON and TEXT/JSON formats is simple. Therefore, the feature of testing an output parameter expression is not provided for response details in these formats.

    1. On the right side of the Debug dialog box, click Click to test the regular expression for an API operation.

    2. In the dialog box that appears, configure the Source, Regular Expression, and Nth match parameters. Then, click Test Expression. You can prejudge whether the extracted information meets your expectations based on the matching result of the response details.

    3. If you need to change the configurations of output parameters, click Sync Output Parameter to synchronize the regular expression to the output parameters of the API operation.

      Note

      After the debugging is complete, you must go back to the Scenario Settings tab and configure the name of the output parameter on the Output Parameter Definition subtab.

Interface description for testing a JMeter scenario

The following figure shows the information that is displayed on the interface when you debug a JMeter scenario.

image

Click Sampler. Then, view the request details, response details, and the timing waterfall in the Sampling log section.

  • The Sampling log section displays the following information:

    • The General tab displays the URL, method, and status code of the request.

    • The Request Details tab displays the header, body, and original packet of the request.

    • The Response Details tab displays the header, body, and original packet of the response.

    • The Timing tab displays the time consumption information of all API operations.

  • The Engine logs section displays the operation logs of Apache JMeter. If no sample logs are returned after debugging, you can analyze and troubleshoot issues based on the error messages in the engine logs. For information about common errors and causes of the errors, see Common errors.