{
  "schema_version": 2,
  "id": "operate/rs/references/rest-api/requests/bdbs/sync_source_stats",
  "title": "Database syncer source stats requests",
  "url": "https://redis.io/docs/latest/operate/rs/references/rest-api/requests/bdbs/sync_source_stats/",
  "summary": "Syncer source statistics requests",
  "tags": [
    "docs",
    "operate",
    "rs"
  ],
  "last_updated": "2025-03-10T13:08:54-04:00",
  "page_type": "content",
  "content_hash": "91dce3d66793bb646def44d0187402bb5d94dd66c68c92a5edca25320f2ae85b",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Method | Path | Description |\n|--------|------|-------------|\n| [GET](#get-all-bdbs-sync_source_stats) | `/v1/bdbs/{bdb_uid}/sync_source_stats` | Get stats for all syncer sources |\n| [GET](#get-bdbs-sync_source_stats) | `/v1/bdbs/{bdb_uid}/sync_source_stats/{uid}` | Get stats for a specific syncer instance |"
    },
    {
      "id": "get-all-bdbs-sync_source_stats",
      "title": "Get all syncer source stats",
      "role": "content",
      "text": "[code example]\n\nGet stats for all syncer sources of a local database."
    },
    {
      "id": "permissions",
      "title": "Permissions",
      "role": "security",
      "text": "| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_stats) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager |"
    },
    {
      "id": "get-all-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\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| bdb_uid | integer | The unique ID of the local database. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval 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 | Optional 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) |"
    },
    {
      "id": "get-all-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for all syncer sources.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-all-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| 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) | Database does not exist. |"
    },
    {
      "id": "get-bdbs-sync_source_stats",
      "title": "Get syncer instance stats",
      "role": "content",
      "text": "[code example]\n\nGet stats for a specific syncer (Replica Of) instance.\n\n#### Permissions\n\n| Permission name | Roles |\n|-----------------|-------|\n| [view_bdb_stats](https://redis.io/docs/latest/operate/rs/references/rest-api/permissions#view_bdb_stats) | admin<br />cluster_member<br />cluster_viewer<br />db_member<br />db_viewer<br />user_manager |"
    },
    {
      "id": "get-request",
      "title": "Request",
      "role": "content",
      "text": "#### Example HTTP request\n\n[code example]\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| bdb_uid | integer | The unique ID of the local database. |\n| uid | integer | The sync_source uid. |\n\n#### Query parameters\n\n| Field | Type | Description |\n|-------|------|-------------|\n| interval | string | Time interval for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional) |\n| stime | ISO_8601 | Optional 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 | Optional 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) |"
    },
    {
      "id": "get-response",
      "title": "Response",
      "role": "returns",
      "text": "Returns [statistics](https://redis.io/docs/latest/operate/rs/references/rest-api/objects/statistics) for a specific syncer instance.\n\n#### Example JSON body\n\n[code example]"
    },
    {
      "id": "get-status-codes",
      "title": "Status codes",
      "role": "content",
      "text": "| 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) | Database or sync_source do not exist. |"
    }
  ],
  "examples": [
    {
      "id": "get-all-bdbs-sync_source_stats-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/{bdb_uid}/sync_source_stats",
      "section_id": "get-all-bdbs-sync_source_stats"
    },
    {
      "id": "get-all-request-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/1/sync_source_stats?interval=5min",
      "section_id": "get-all-request"
    },
    {
      "id": "get-all-response-ex0",
      "language": "json",
      "code": "{ \"sync_source_stats\": [\n     {\n         \"intervals\": [\n             {\n                 \"etime\": \"2017-10-22T19:30:00Z\",\n                 \"ingress_bytes\": 18528,\n                 \"ingress_bytes_decompressed\": 185992,\n                 \"interval\": \"5min\",\n                 \"local_ingress_lag_time\": 0.244,\n                 \"stime\": \"2017-10-22T19:25:00Z\"\n             },\n             {\n                 \"etime\": \"2017-10-22T19:35:00Z\",\n                 \"ingress_bytes\": 18,\n                 \"ingress_bytes_decompressed\": 192,\n                 \"interval\": \"5min\",\n                 \"local_ingress_lag_time\": 0.0,\n                 \"stime\": \"2017-10-22T19:30:00Z\"\n             }\n         ],\n         \"uid\": \"1\"\n     }\n   ]\n }",
      "section_id": "get-all-response"
    },
    {
      "id": "get-bdbs-sync_source_stats-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/{bdb_uid}/sync_source_stats/{int: uid}",
      "section_id": "get-bdbs-sync_source_stats"
    },
    {
      "id": "get-request-ex0",
      "language": "sh",
      "code": "GET /v1/bdbs/1/sync_source_stats/1?interval=5min",
      "section_id": "get-request"
    },
    {
      "id": "get-response-ex0",
      "language": "json",
      "code": "{\n    \"intervals\": [\n        {\n            \"etime\": \"2017-10-22T19:30:00Z\",\n            \"ingress_bytes\": 18528,\n            \"ingress_bytes_decompressed\": 185992,\n            \"interval\": \"5min\",\n            \"local_ingress_lag_time\": 0.244,\n            \"stime\": \"2017-10-22T19:25:00Z\"\n        },\n        {\n            \"etime\": \"2017-10-22T19:35:00Z\",\n            \"ingress_bytes\": 18,\n            \"ingress_bytes_decompressed\": 192,\n            \"interval\": \"5min\",\n            \"local_ingress_lag_time\": 0.0,\n            \"stime\": \"2017-10-22T19:30:00Z\"\n        }\n    ],\n    \"uid\": \"1\"\n}",
      "section_id": "get-response"
    }
  ]
}
