nav-img
Advanced

Configuring SLAs

A Service Level Agreement (SLA) defines criteria for performance metrics. You can gain a better understanding of the performance of your service by checking if the metrics meet the criteria specified in the SLA.

Only CPTS test projects support SLAs. JMeter test projects do not support. When the SLA metric thresholds are met, alarms will be generated or the performance tests will be stopped.

You can create SLAs in either of the following ways:

Creating and Importing an SLA Template

  1. Log in to the CPTS console, choose SLAs in the navigation pane, and click Create SLA Template.

    Note

    You can create up to 20 SLA templates in your account in each region.

  2. Set the SLA basic information.

    • SLA Name: This is used to identify an SLA. The SLA name must be unique in a region.
    • SLA Description: This parameter is optional.

  3. Click Create Rule.
  4. Set the SLA rules by referring to Table 1.

    Table 1 SLA rule parameters

    Parameter

    Description

    Rule Name

    This is used to identify a rule.

    Metric

    Three types of metrics are supported. CPTS will generate an alarm or stop a performance test when the metric reaches the specified threshold.

    • Average response time (RT)
    • Requests per second (RPS)
    • Success rate

    Thresholds

    Thresholds for triggering an alarm or stopping a performance test.

    For example, if you set the metric threshold for Stop Test to < 100 and 3 consecutive times, the test task will be stopped when the metric exceeds 100 for three consecutive times.

    Figure 1 Creating SLA rules in a template


  5. Click OK to complete the rule creation.
  6. (Optional) To create multiple rules, repeat 3 to 5.

    Note

    Up to five rules can be created for each SLA.

  7. Click OK to complete the SLA template creation.

    You can view the created SLA template on the SLAs page.

    Note

    To edit or delete an SLA template, locate the row that contains the SLA template, and click Edit or Delete.

  8. In the navigation pane, choose CPTS Test Projects. Locate the row that contains the project for which you want to configure an SLA, and click Edit Test Task.
  9. On the Test Tasks tab, click to expand the test task.
  10. Click the SLA tab.
  11. Click Import from SLA Template.
  12. Select an SLA template for SLA Template.
  13. In the SLA Rules area, select one or more requests to which the SLA rules will be applied.

    You can also edit, delete, or add rules as required.

    Note

    SLA rules do not take effect for preset cases.

  14. Click Save to finish the SLA configuration.
  15. Click Start in the row where the test task name is displayed to start the task.
  16. Select a resource group and click Start.
  17. Click View Report. The Real-Time Reports tab is displayed.
  18. Select the test task for which you have configured the SLA in 15. Choose the SLA Report tab, and check whether the SLA rules are triggered during the testing.

    Metrics configured in the SLA rules are collected every 6 seconds. If an SLA rule is triggered, when and how many times the rule is triggered and the request name will be displayed in the Trigger Events area.

    Note

    You can also check the offline test report when the test task is complete. Choose the Offline Reports tab, click View Report in the row containing the test task. Choose the SLA Report tab, and check whether the SLA rules were triggered during the testing.

Creating an SLA for a Specific Test Task

  1. Log in to the CPTS console and choose CPTS Test Projects in the navigation pane on the left.
  2. Locate the row that contains the project for which you want to configure an SLA, and click Edit Test Task.
  3. On the Test Tasks tab, click to expand the test task.
  4. Click the SLA tab.
  5. Click Create SLA.
  6. Set the SLA basic information.

    • SLA Name: custom SLA name.
    • SLA Description: This parameter is optional.

  7. Click Create Rule.
  8. Set the SLA rules by referring to Table 2.

    Table 2 SLA rule parameters

    Parameter

    Description

    Rule Name

    This is used to identify a rule.

    Metric

    Three types of metrics are supported. CPTS will generate an alarm or stop a performance test when the metric reaches the specified threshold.

    • Average response time (RT)
    • Requests per second (RPS)
    • Success rate

    Thresholds

    Thresholds for triggering an alarm or stopping a performance test.

    For example, if you set the metric threshold for Stop Test to < 100 and 3 consecutive times, the test task will be stopped when the metric exceeds 100 for three consecutive times.

    Figure 2 Creating SLA rules for a specific test task


  9. (Optional) To create multiple rules, repeat 7 to 8.

    Note

    Up to five rules can be created for each SLA.

  10. In the Target Requests column, select one or more requests for each rule.

    Note

    SLA rules do not take effect for preset cases.

  11. Click Save to finish the SLA configuration.
  12. Click Start in the row where the test task name is displayed to start the task.
  13. Select a resource group and click Start.
  14. Click View Report. The Real-Time Reports tab is displayed.
  15. Select the test task for which you have configured the SLA in 12. Choose the SLA Report tab, and check whether the SLA rules are triggered during the testing.

    Metrics configured in the SLA rules are collected every 6 seconds. If an SLA rule is triggered, when and how many times the rule is triggered and the request name will be displayed in the Trigger Events area.

    Note

    You can also check the offline test report when the test task is complete. Choose the Offline Reports tab, click View Report in the row containing the test task. Choose the SLA Report tab, and check whether the SLA rules were triggered during the testing.