# LATENCY LATEST

> Return the latest and the worst latency spike of each monitored event.

URL: https://docs.hotkv.com/commands/latency-latest/

```
LATENCY LATEST
```

- Group: Server
- Complexity: O(N) where N is the number of events
- HotKV Cloud: all plans
- On-Premise: no license needed

`LATENCY LATEST` gives one line per event that has had a latency spike since
the monitor started or was last reset: when the latest spike happened, how
long it took, and the worst spike ever recorded for that event. Spikes are
only recorded while `latency-monitor-threshold` is above `0`; see
[LATENCY](https://docs.hotkv.com/commands/latency/index.md).

## Return value

An array with one entry per event, in RESP2 and RESP3. Each entry is an array
of four elements:

1. The event name, a bulk string (`command`, `fast-command`, `expire-cycle`).
2. The Unix time, in seconds, of the latest spike.
3. The latest spike's duration in milliseconds.
4. The worst spike's duration in milliseconds.

An empty array when nothing has been recorded.

## Examples

```
127.0.0.1:6379> LATENCY LATEST
1) 1) "command"
   2) (integer) 1790000000
   3) (integer) 120
   4) (integer) 340
2) 1) "expire-cycle"
   2) (integer) 1789999420
   3) (integer) 55
   4) (integer) 55
```

## Compatibility

Same reply shape as Redis 7 and Valkey 8.

## See also

[LATENCY HISTORY](https://docs.hotkv.com/commands/latency-history/index.md), [LATENCY DOCTOR](https://docs.hotkv.com/commands/latency-doctor/index.md),
[LATENCY RESET](https://docs.hotkv.com/commands/latency-reset/index.md)