延迟直方图

Syntax
LATENCY HISTOGRAM [command [command ...]]
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,

LATENCY HISTOGRAM 返回命令延迟的累积分布,以直方图格式显示。

默认情况下,返回所有可用的延迟直方图。 您可以通过提供特定的命令名称来过滤回复。

每个直方图由以下字段组成:

  • 命令名称
  • 该命令的总调用次数
  • 时间桶的映射:
    • 每个桶代表一个延迟范围
    • 每个桶的范围是前一个桶的两倍
    • 空的桶不会包含在回复中
    • 跟踪的延迟在1纳秒到大约1秒之间
    • 超过1秒的所有内容都被视为+Inf
    • 最多会有log2(1,000,000,000) = 30个桶

此命令需要启用扩展延迟监控功能,这是默认设置。 如果您需要启用它,请调用CONFIG SET latency-tracking yes

要删除延迟直方图的数据,请使用CONFIG RESETSTAT命令。

示例

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

RESP2 回复

Array reply: 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.

RESP3 回复

Map reply: 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.
RATE THIS PAGE
Back to top ↑