---
title: ERL
url: https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/erl/class.ERL/
---

**Kind:** Class  
**Module:** [erl](https://www.fastly.com/documentation/reference/compute/sdks/cpp/fastly/erl/)  
**Package:** compute-sdk-cpp 0.7.0  
**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/erl.h#L78

Include `fastly/erl.h` to use this class.

## Constructor

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/erl.h#L80

```cpp
fastly::erl::ERL::ERL(RateCounter rate_counter, PenaltyBox penalty_box)
```

**Parameters**

- `rate_counter`: `RateCounter`
- `penalty_box`: `PenaltyBox`

## Methods

### check_rate

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/erl.h#L90

```cpp
tl::expected<bool, ERLError> fastly::erl::ERL::check_rate(std::string_view entry, std::uint32_t delta, RateWindow window, std::uint32_t limit, std::chrono::minutes ttl) const
```

Increment an entry in a rate counter and check if the client has exceeded some average number of requests per second (RPS) over the window. If the client is over the rps limit for the window, add to the penaltybox for ttl. Valid ttl span is 1m to 1h.

**Parameters**

- `entry`: `std::string_view`
- `delta`: `std::uint32_t`
- `window`: `RateWindow`
- `limit`: `std::uint32_t`
- `ttl`: `std::chrono::minutes`

**Returns**

`tl::expected<bool, ERLError>`

### penalty_box

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/erl.h#L94

```cpp
const PenaltyBox & fastly::erl::ERL::penalty_box() const
```

**Returns**

`const PenaltyBox &`

### rate_counter

**Source:** https://github.com/fastly/compute-sdk-cpp/blob/ff911e47be2f319e83a9cde960d2c3c5db534280/include/fastly/erl.h#L93

```cpp
const RateCounter & fastly::erl::ERL::rate_counter() const
```

**Returns**

`const RateCounter &`
