{
  "id": "stats",
  "title": "Database stats requests",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/bdbs/stats/",
  "summary": "Database statistics requests",
  "content": "\n| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-bdbs-stats) | `/v1/bdbs/stats` | Get stats for all databases |\n| [GET](#get-bdbs-stats) | `/v1/bdbs/stats/{uid}` | Get stats for a specific database |\n\n## Get all database stats {#get-all-bdbs-stats}\n\n```sh\nGET /v1/bdbs/stats\n```\n\nGet statistics for all databases.\n\n### Permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_all_bdb_stats]() | admin\u003cbr /\u003ecluster_member\u003cbr /\u003ecluster_viewer\u003cbr /\u003edb_member\u003cbr /\u003edb_viewer\u003cbr /\u003euser_manager |\n\n### Request {#get-all-request}\n\n#### Example HTTP request\n\n```sh\nGET /v1/bdbs/stats?interval=1hour\u0026stime=2014-08-28T10:00:00Z\n```\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n\n### Response {#get-all-response}\n\nReturns [statistics]() for all databases.\n\n#### Example JSON body\n\n```json\n[\n  {\n    \"uid\": \"1\",\n    \"intervals\": [\n      {\n         \"interval\": \"1hour\",\n         \"stime\": \"2015-05-27T12:00:00Z\",\n         \"etime\": \"2015-05-28T12:59:59Z\",\n         \"avg_latency\": 0.0,\n         \"conns\": 0.0,\n         \"egress_bytes\": 0.0,\n         \"etime\": \"2015-05-28T00:00:00Z\",\n         \"evicted_objects\": 0.0,\n         \"expired_objects\": 0.0,\n         \"ingress_bytes\": 0.0,\n         \"instantaneous_ops_per_sec\": 0.00011973180076628352,\n         \"last_req_time\": \"1970-01-01T00:00:00Z\",\n         \"last_res_time\": \"1970-01-01T00:00:00Z\",\n         \"used_memory\": 5656299.362068966,\n         \"mem_size_lua\": 35840.0,\n         \"monitor_sessions_count\": 0.0,\n         \"no_of_keys\": 0.0,\n         \"other_req\": 0.0,\n         \"other_res\": 0.0,\n         \"read_hits\": 0.0,\n         \"read_misses\": 0.0,\n         \"read_req\": 0.0,\n         \"read_res\": 0.0,\n         \"total_connections_received\": 0.0,\n         \"total_req\": 0.0,\n         \"total_res\": 0.0,\n         \"write_hits\": 0.0,\n         \"write_misses\": 0.0,\n         \"write_req\": 0.0,\n         \"write_res\": 0.0\n      },\n      {\n         \"interval\": \"1hour\",\n         \"interval\": \"1hour\",\n         \"stime\": \"2015-05-27T13:00:00Z\",\n         \"etime\": \"2015-05-28T13:59:59Z\",\n         \"avg_latency\": 599.08,\n         \"// additional fields...\"\n      }\n    ]\n  },\n  {\n    \"uid\": \"2\",\n    \"intervals\": [\n      {\n        \"interval\": \"1hour\",\n        \"stime\": \"2015-05-27T12:00:00Z\",\n        \"etime\": \"2015-05-28T12:59:59Z\",\n        \"avg_latency\": 0.0,\n        \"// additional fields...\"\n      },\n      {\n        \"interval\": \"1hour\",\n        \"stime\": \"2015-05-27T13:00:00Z\",\n        \"etime\": \"2015-05-28T13:59:59Z\",\n\n        \"// additional fields...\"\n      }\n    ]\n  }\n]\n```\n\n#### Status codes {#get-all-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | No bdbs exist |\n\n### Example requests\n\n#### cURL\n\n```sh\n$ curl -k -u \"[username]:[password]\" -X GET\n        https://[host][:port]/v1/bdbs/stats?interval=1hour\n```\n\n#### Python\n\n```python\nimport requests\n\nurl = \"https://[host][:port]/v1/bdbs/stats?interval=1hour\"\nauth = (\"[username]\", \"[password]\")\n\nresponse = requests.request(\"GET\", url, auth=auth)\n\nprint(response.text)\n```\n\n## Get database stats {#get-bdbs-stats}\n\n```sh\nGET /v1/bdbs/stats/{int: uid}\n```\n\nGet statistics for a specific database.\n\n### Permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_stats]() | admin\u003cbr /\u003ecluster_member\u003cbr /\u003ecluster_viewer\u003cbr /\u003edb_member\u003cbr /\u003edb_viewer\u003cbr /\u003euser_manager |\n\n### Request {#get-request}\n\n#### Example HTTP request\n\n```sh\nGET /v1/bdbs/stats/1?interval=1hour\u0026stime=2014-08-28T10:00:00Z\n```\n\n#### Headers\n\n| Key | Value | Description |\n|-----|-------|-------------|\n| Host | cnm.cluster.fqdn | Domain name |\n| Accept | application/json | Accepted media type |\n\n#### URL parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| uid | integer | The unique ID of the BDB requested. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) |\n| stime | ISO_8601 | Start time from which we want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n| etime | ISO_8601 | End time after which we don't want the stats. Should comply with the [ISO_8601](https://en.wikipedia.org/wiki/ISO_8601) format (optional) |\n\n### Response {#get-response}\n\nReturns [statistics]() for a specific database.\n\n#### Example JSON body\n\n```json\n{\n  \"uid\": \"1\",\n  \"intervals\": [\n    {\n      \"interval\": \"1hour\",\n      \"stime\": \"2015-05-27T12:00:00Z\",\n      \"etime\": \"2015-05-28T12:59:59Z\",\n      \"avg_latency\": 0.0,\n      \"conns\": 0.0,\n      \"egress_bytes\": 0.0,\n      \"evicted_objects\": 0.0,\n      \"pubsub_channels\": 0,\n      \"pubsub_patterns\": 0,\n      \"expired_objects\": 0.0,\n      \"ingress_bytes\": 0.0,\n      \"instantaneous_ops_per_sec\": 0.00011973180076628352,\n      \"last_req_time\": \"1970-01-01T00:00:00Z\",\n      \"last_res_time\": \"1970-01-01T00:00:00Z\",\n      \"used_memory\": 5656299.362068966,\n      \"mem_size_lua\": 35840.0,\n      \"monitor_sessions_count\": 0.0,\n      \"no_of_keys\": 0.0,\n      \"other_req\": 0.0,\n      \"other_res\": 0.0,\n      \"read_hits\": 0.0,\n      \"read_misses\": 0.0,\n      \"read_req\": 0.0,\n      \"read_res\": 0.0,\n      \"total_connections_received\": 0.0,\n      \"total_req\": 0.0,\n      \"total_res\": 0.0,\n      \"write_hits\": 0.0,\n      \"write_misses\": 0.0,\n      \"write_req\": 0.0,\n      \"write_res\": 0.0\n    },\n    {\n      \"interval\": \"1hour\",\n      \"stime\": \"2015-05-27T13:00:00Z\",\n      \"etime\": \"2015-05-28T13:59:59Z\",\n      \"// additional fields...\"\n    }\n  ]\n}\n```\n\n#### Status codes {#get-status-codes}\n\n| Code | Description |\n|------|-------------|\n| [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error |\n| [404 Not Found](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5) | bdb does not exist |\n| [406 Not Acceptable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7) | bdb isn't currently active |\n| [503 Service Unavailable](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4) | bdb is in recovery state |\n",
  "tags": ["docs","operate","rs"],
  "last_updated": "2026-04-01T08:10:08-05:00",
  "children": [{"id":"last","summary":"Most recent database statistics requests","title":"Latest database stats requests","url":"https://redis.io/docs/latest/operate/rs/7.8/references/rest-api/requests/bdbs/stats/last/"}]
}

