Updated on 2024-01-15 GMT+08:00

Native JMeter Pressure Test

  1. When the JMeter test plan is debugged, save the JMX and CSV files.
  2. Prepare test resources and create a private resource group.

    1. Log in to the CodeArts PerfTest console, choose Resource Groups in the navigation pane, and click Create Resource Group.
    2. (Optional) If this is the first time you create a private resource group, grant CodeArts PerfTest permissions necessary for creating private resource groups.
    3. If you do not have a CCE cluster, perform 2.d to create one before creating a resource group. If a CCE cluster is available, go to 2.e to create a resource group.
    4. Create a cluster.

      In the upper part of the page, click create one. The CCE console is displayed. For details about how to create a cluster, see Buying a CCE Cluster.

      • The cluster management scale is related to the number of execution nodes. Create nodes of the corresponding specifications based on the number of concurrent users for pressure testing. For example, if 20 execution nodes are required, you can set the cluster scale to 50 nodes.
      • You are advised to select Tunnel network as the network model. Container CIDR Block and Service CIDR Block must be the same as those of the tested application.

      Click Next: Add-on Configuration. Retain the default settings.

      Click Next: Confirm. After confirming that the cluster configuration information is correct, select I have read and understood the preceding instructions and click Submit. It takes about 6 to 10 minutes to create a cluster.

      After the cluster is created, return to the Cluster Management page and click in the row where the cluster for which you want to create a node is located. The Create Node page is displayed. For details about how to create a node, see Creating a Node.

      • A node must have at least four vCPUs and 8 GB memory.
      • Select EulerOS as the operating system.
      • At least two nodes (one debugging node and one execution node) are required. The number of nodes depends on the specifications of the pressure test object. For example, 21 execution nodes (one debugging node and 20 execution nodes) are required for 100,000 concurrent users and 4 vCPUs | 8 GB memory.
      • If the CCE cluster node and the application to be tested are not in the same VPC network, bind an EIP to the CCE cluster node. You can use existing EIPs. If no EIP is available, click Auto create to create one. When EIPs are automatically created, you are advised to pay by traffic and set the bandwidth to a large value to avoid affecting the pressure test. Additionally, an EIP with specified configurations is automatically assigned to each node. If the number of EIPs is smaller than the number of nodes, the EIPs are randomly bound to the nodes.

      Click Next: Confirm. After confirming that the node configuration information is correct, select I have read and understood the preceding instructions and click Submit.

      After the node is created, return to the CodeArts PerfTest console.

    5. Create a resource group.

      Choose Resource Groups in the navigation pane, and click Create Private Resource Group.

      Set the parameters listed in Table 1.
      Table 1 Creating a private resource group

      Parameter

      Description

      Resource Group Name

      Name of the private resource group to be created.

      Debugging Cluster

      Select a CCE cluster from the drop-down list.

      Debug Node

      Select the management node that performs a pressure test.

      The debugging node cannot be changed after the resource group is created.

      Execution Node

      Select a pressure target machine that provides performance data during a pressure test.

      Click Create.

  3. Create a JMeter test project.

    Go back to the CodeArts PerfTest console and choose JMeter Projects in the navigation pane. Click Create JMeter Project. Enter the project name and click OK.

  4. Import a JMX file.

    1. On the JMeter Projects page, click to edit the test plan.
    2. On the test plan tab, click Add Task Plan.
    3. In the dialog box that is displayed, click Select File, select a JMX file, and click Upload. When the file is imported, the dialog box closes automatically and the Test Plan List tab is displayed. You can view the added test plan.
      Figure 1 Importing a JMX file
      • The maximum size of a JMX file is 10 MB.
      • Basic JMeter scripts are supported, including thread groups, HTTP requests, HTTP header managers, request parameters, BeanShell, and timeout periods. You are advised to use a script of version 5.2.1 or later. Otherwise, a script parsing error may occur.
    4. (Optional) On the test plan tab page, click Third Party Jar. In the displayed dialog box, click Import File, select and import the JAR package on which the test plan depends. After the package is imported, the dialog box closes.
      Figure 2 Importing a JAR package

      The maximum size of a JAR package is 10 MB.

  5. (Optional) Import the variable file.

    In the test plan list, click and choose Variable File. In the displayed dialog box, click Local Import, select the variable file referenced by the test plan, and import the file. After the file is imported successfully, close the dialog box.

    Figure 3 Importing variable file 1
    Figure 4 Importing variable file 2

  6. Edit a thread group.

    Click the task name in the JMeter test plan list. The thread group list is displayed. After the editing is complete, click OK.
    • Number of threads corresponds to Number of Threads in the local JMeter program.
    • Warm-up Time corresponds to Ramp-up period in the local JMeter program.
    • Number of Cycles indicates the number of cycles to be tested.
    Figure 5 Editing a thread group

  7. Debug the JMeter test task.

    Click Debug, select the target test resource group as the executor, and click Start to start debugging. If an error was reported in the debugging result, edit the case based on the log information and debug it again.

    Figure 6 Starting debugging

  8. Execute the JMeter test task.

    Click Start. In the dialog box that is displayed, specify Resource Group Type and Enterprise, and click Start to start the test task.
    Figure 7 Starting a test task

  9. View a test report.

    After the test task is started, click View Report to view the monitoring data and chart report of each metric generated during the pressure test.

    After the pressure test is complete, an offline test result report is generated automatically. You can download and view the report of the completed test task.