分片统计请求

分片统计信息请求

Redis 企业软件
方法 路径 描述
获取 /v1/shards/stats 获取所有分片的统计信息
获取 /v1/shards/stats/{uid} 获取特定分片的统计信息

获取所有分片统计数据

GET /v1/shards/stats

获取所有分片的统计信息。

所需权限

权限名称
view_all_shard_stats

请求

HTTP 请求示例

GET /v1/shards/stats?interval=1hour&stime=2014-08-28T10:00:00Z 

请求标头

钥匙 价值 描述
主机 cnm.cluster.fqdn 中 域名
接受 应用程序/JSON 接受的媒体类型

查询参数

类型 描述
parent_uid 整数 仅从给定的 BDB ID 返回分片(可选)
间隔 字符串 我们需要统计数据的时间间隔:1 秒/10 秒/5 分钟/15 分钟/1 小时/12 小时/1 周(可选)
时间 ISO_8601 我们想要统计数据的开始时间。应符合 ISO_8601 格式(可选)
etime (英语) ISO_8601 End time 之后我们不需要统计数据。应符合 ISO_8601 格式(可选)
指标 列表 我们需要统计数据的指标名称的逗号分隔列表(默认为 all)(可选)

响应

返回所有分片的统计信息的 JSON 数组。

示例 JSON 正文

[
  {
    "status": "active",
    "uid": "1",
    "node_uid": "1",
    "assigned_slots": "0-8191",
    "intervals": [
    {
      "interval": "1sec",
      "stime": "2015-05-28T08:27:35Z",
      "etime": "2015-05-28T08:27:40Z",
      "used_memory_peak": 5888264.0,
      "used_memory_rss": 5888264.0,
      "read_hits": 0.0,
      "pubsub_patterns": 0.0,
      "no_of_keys": 0.0,
      "mem_size_lua": 35840.0,
      "last_save_time": 1432541051.0,
      "sync_partial_ok": 0.0,
      "connected_clients": 9.0,
      "avg_ttl": 0.0,
      "write_misses": 0.0,
      "used_memory": 5651440.0,
      "sync_full": 0.0,
      "expired_objects": 0.0,
      "total_req": 0.0,
      "blocked_clients": 0.0,
      "pubsub_channels": 0.0,
      "evicted_objects": 0.0,
      "no_of_expires": 0.0,
      "interval": "1sec",
      "write_hits": 0.0,
      "read_misses": 0.0,
      "sync_partial_err": 0.0,
      "rdb_changes_since_last_save": 0.0
    },
    {
      "interval": "1sec",
      "stime": "2015-05-28T08:27:40Z",
      "etime": "2015-05-28T08:27:45Z",
      "// additional fields..."
      }
    ]
  },
  {
    "uid": "2",
    "status": "active",
    "node_uid": "1",
    "assigned_slots": "8192-16383",
    "intervals": [
      {
        "interval": "1sec",
        "stime": "2015-05-28T08:27:35Z",
        "etime": "2015-05-28T08:27:40Z",
        "// additional fields..."
      },
      {
        "interval": "1sec",
        "stime": "2015-05-28T08:27:40Z",
        "etime": "2015-05-28T08:27:45Z",
        "// additional fields..."
      }
    ]
  }
]

Status codes

Code Description
200 OK No error
404 Not Found No shards exist

Get shard stats

GET /v1/shards/stats/{int: uid}

Get statistics for a specific shard.

Required permissions

Permission name
view_shard_stats

Request

Example HTTP request

GET /v1/shards/stats/1?interval=1hour&stime=2014-08-28T10:00:00Z 

Request headers

Key Value Description
Host cnm.cluster.fqdn Domain name
Accept application/json Accepted media type

URL parameters

Field Type Description
uid integer The unique ID of the shard requested.

Query parameters

Field Type Description
interval string Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional)
stime ISO_8601 Start time from which we want the stats. Should comply with the ISO_8601 format (optional)
etime ISO_8601 End time after which we don't want the stats. Should comply with the ISO_8601 format (optional)

Response

Returns statistics for the specified shard.

Example JSON body

{
  "uid": "1",
  "status": "active",
  "node_uid": "1",
  "role": "master",
  "intervals": [
    {
      "interval": "1sec",
      "stime": "2015-05-28T08:24:13Z",
      "etime": "2015-05-28T08:24:18Z",
      "avg_ttl": 0.0,
      "blocked_clients": 0.0,
      "connected_clients": 9.0,
      "etime": "2015-05-28T08:24:18Z",
      "evicted_objects": 0.0,
      "expired_objects": 0.0,
      "last_save_time": 1432541051.0,
      "used_memory": 5651440.0,
      "mem_size_lua": 35840.0,
      "used_memory_peak": 5888264.0,
      "used_memory_rss": 5888264.0,
      "no_of_expires": 0.0,
      "no_of_keys": 0.0,
      "pubsub_channels": 0.0,
      "pubsub_patterns": 0.0,
      "rdb_changes_since_last_save": 0.0,
      "read_hits": 0.0,
      "read_misses": 0.0,
      "stime": "2015-05-28T08:24:13Z",
      "sync_full": 0.0,
      "sync_partial_err": 0.0,
      "sync_partial_ok": 0.0,
      "total_req": 0.0,
      "write_hits": 0.0,
      "write_misses": 0.0
    },
    {
      "interval": "1sec",
      "stime": "2015-05-28T08:24:18Z",
      "etime": "2015-05-28T08:24:23Z",

      "// additional fields..."
    }
  ]
}

Status codes

Code Description
200 OK No error
404 Not Found Shard does not exist
406 Not Acceptable Shard isn't currently active
RATE THIS PAGE
Back to top ↑