Available since: 7.0.0
Time complexity: O(N) where N is the number of commands with latency information being retrieved.
ACL categories:
@admin
@slow
@dangerous
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:
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
.
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
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.