# LATENCY GRAPH

> Draw one event's recorded latency spikes as a text bar chart.

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

```
LATENCY GRAPH 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 GRAPH` draws the spikes recorded for one event as a text chart you
can read in a terminal: a heading with the highest and lowest spike shown
and the all-time worst, then one bar per spike, oldest first, labelled with
how long ago it happened and its duration. Bars are scaled to the highest
spike shown. The event name is case-sensitive.

## Return value

The chart as text: a bulk string in RESP2, a verbatim string (`txt`) in
RESP3. An event with no spikes, or an unknown name, gets
`ERR No samples available for event '<event>'`.

## Examples

```
127.0.0.1:6379> LATENCY GRAPH command
command - high 120 ms, low 60 ms (all time high 340 ms)
     310s ago ######################### 60 ms
     200s ago ############################### 75 ms
       5s ago ################################################## 120 ms
```

## Compatibility

Redis 7 and Valkey 8 have the same command but draw a different chart
(vertical, with time on the horizontal axis). Use
[LATENCY HISTORY](https://docs.hotkv.com/commands/latency-history/index.md) if you need the numbers.

## See also

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