summaryrefslogtreecommitdiffstats
path: root/iredis/data/commands/latency-histogram.md
blob: a97928b6146f438d4c787760b8af02fafba4a756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
The `LATENCY HISTOGRAM` command reports a cumulative distribution of latencies in the format of a histogram for each of the specified command names. 
If no command names are specified then all commands that contain latency information will be replied.

Each reported histogram has the following fields:

* Command name.
* The total calls for that command.
* A map of time buckets:
  * Each bucket represents a latency range.
  * Each bucket covers twice the previous bucket's range.
  * Empty buckets are not printed.
  * The tracked latencies are between 1 microsecond and roughly 1 second.
  * Everything above 1 sec is considered +Inf.
  * At max there will be log2(1000000000)=30 buckets.

This command requires the extended latency monitoring feature to be enabled (by default it's enabled).
If you need to enable it, use `CONFIG SET latency-tracking yes`.

@examples

```
127.0.0.1:6379> LATENCY HISTOGRAM set
1# "set" =>
   1# "calls" => (integer) 100000
   2# "histogram_usec" =>
      1# (integer) 1 => (integer) 99583
      2# (integer) 2 => (integer) 99852
      3# (integer) 4 => (integer) 99914
      4# (integer) 8 => (integer) 99940
      5# (integer) 16 => (integer) 99968
      6# (integer) 33 => (integer) 100000
```

@return

@array-reply: specifically:

The command returns a map where each key is a command name, and each value is a map with the total calls, and an inner map of the histogram time buckets.