# LATENCY HISTORY

> Return the recorded latency spikes of one event, oldest first.

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

```
LATENCY HISTORY event
```

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

`LATENCY HISTORY` returns the spikes recorded for one event, oldest first.
Each event keeps its most recent 160 spikes. The event name is
case-sensitive: use it exactly as [LATENCY LATEST](https://docs.hotkv.com/commands/latency-latest/index.md)
shows it.

## Return value

An array of `[unix-time, milliseconds]` pairs (two integers each), in RESP2
and RESP3. An event with no spikes, or an unknown name, gives an empty array.
Any number of arguments other than one event gets
`ERR wrong number of arguments for 'latency|history' command`.

## Examples

```
127.0.0.1:6379> LATENCY HISTORY command
1) 1) (integer) 1789999800
   2) (integer) 75
2) 1) (integer) 1790000000
   2) (integer) 120
```

## Compatibility

Same reply shape as Redis 7 and Valkey 8.

## See also

[LATENCY GRAPH](https://docs.hotkv.com/commands/latency-graph/index.md), [LATENCY LATEST](https://docs.hotkv.com/commands/latency-latest/index.md)