> OctoPerf load testing - Service Level Agreement Profiles documentation page. To configure, in one place, the Service Level Agreement of the application tested.

Source: https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/

# Service Level Agreement Profiles

![sla-menu](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/img/sla-menu.png){ align=left }

The SLA Profiles page lets you **configure, in one place, the Service Level Agreement of the application tested**.

- Create several SLA profiles, for instance to deal with transactions that have very different expected response times.
- Apply several criteria inside a single SLA profile, for instance when you need to control response times and error rate.

!!! tip
    To apply an SLA profile, you can [drop an SLA action](https://api.octoperf.com/doc/design/edit-virtual-user/action-types/post-processors/sla-action/) under a HTTP Request or Container in the [Virtual User tree](https://api.octoperf.com/doc/design/edit-virtual-user/virtual-user-tree/), or at the root of the Virtual User.

<div style="clear:both"></div>

## SLA profiles list

![Service Level Agreement](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/img/sla-profiles-list.png "Service Level Agreement")

The **SLA Profile** page uses a layout with the list on the left and edition and usages on the right. The list features all the usual possibilities as described in the [dedicated section about lists](https://api.octoperf.com/doc/navigation/#lists).

## SLA Usage

The Usage tree is a visualization of the selected **SLA profile**. By clicking on a [virtual User](https://api.octoperf.com/doc/design/edit-virtual-user/), you can navigate to it.
![SLA Usage](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/img/sla-profile-usage.png)

## SLA Configuration

![edit-sla](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/img/edit-sla.png)

| Name     | Description                                                  |
| -------- | ------------------------------------------------------------ |
| Metric   | The metric that this **Threshold** will apply to. Only raw metrics can be used, calculated metrics like percentiles are not available since they are processed afterwards. The **custom metric** statistics judge a metric your scripts record, see [below](#custom-metrics). |
| Name     | Display name for this **SLA**.                               |
| Severity | **Passed** for no SLA triggered, otherwise pick **warning** or **critical** depending on severity. |
| From, To | Define the boundaries of this **SLA**.                       |
| During   | **Number of occurrences** or **Time waited** until a failed SLA is reported. Use this to **avoid having too many failed SLA reports** because of single hits above th |

!!! note
    An SLA profile can contain several **Thresholds** and every threshold can contain several **SLAs**. Use this to create a set of rules that corresponds to your application.

## Custom metrics

An SLA profile also judges the [custom metrics](https://api.octoperf.com/doc/analysis/edit-bench-report/metrics-selection/#custom-metrics) of your tests: the `Trend`, `Counter`, `Gauge` and `Rate` of a K6 script, or the [Core Web Vitals](https://api.octoperf.com/doc/design/edit-virtual-user/action-types/playwright-actions/playwright-spec-action/#core-web-vitals) every Playwright test measures.

![Core Web Vitals SLA profile](https://api.octoperf.com/doc/design/edit-virtual-user/configuration/sla-profiles/img/sla-web-vitals.png "A Core Web Vitals threshold: the LCP needs improvement past 2.5 seconds and is poor past 4 seconds")

Pick one of the **custom metric** statistics as the **Metric** of a threshold, then:

| Name               | Description |
|--------------------|-------------|
| Custom metric name | The name the script records the metric under, for instance `LCP` or `checkout_duration`. The Core Web Vitals are suggested. |
| Unit               | The unit of the values: milliseconds, bytes or no unit. The bands are typed in this unit. It only applies to the average, minimum, maximum and total: a count and a rate keep their own unit. |

Naming a Core Web Vital fills the threshold with Google's bands, on the average:

| Metric | Warning (needs improvement) | Critical (poor) |
|--------|-----------------------------|-----------------|
| `LCP`  | over 2.5 s                  | over 4 s        |
| `INP`  | over 200 ms                 | over 500 ms     |
| `CLS`  | over 0.1                    | over 0.25       |
| `FCP`  | over 1.8 s                  | over 3 s        |
| `TTFB` | over 0.8 s                  | over 1.8 s      |

The **Core Web Vitals** card of the SLA Profiles page creates a profile with the five of them at once.

!!! info
    Google rates the 75th percentile of the page loads of a whole visit. An SLA judges the average of each sampling period instead, three periods in a row by default, so that one slow page load raises nothing on its own. `INP` is only measured on a page that received a click or a key press: a period without one is not judged.

!!! warning
    A threshold on a custom metric judges **the whole Virtual User**: drop its [SLA action](https://api.octoperf.com/doc/design/edit-virtual-user/action-types/post-processors/sla-action/) at the root of the Virtual User. Under a container, it is not evaluated.
