content/operate/rs/references/rest-api/requests/bdbs/stats/last.md
| Method | Path | Description |
|---|---|---|
| GET | /v1/bdbs/stats/last | Get most recent stats for all databases |
| GET | /v1/bdbs/stats/last/{uid} | Get most recent stats for a specific database |
GET /v1/bdbs/stats/last
Get the most recent statistics for all databases.
| Permission name | Roles |
|---|---|
| [view_all_bdb_stats]({{< relref "/operate/rs/references/rest-api/permissions#view_all_bdb_stats" >}}) | admin |
| cluster_member | |
| cluster_viewer | |
| db_member | |
| db_viewer | |
| user_manager |
Without metrics filter (returns all metrics by default)
GET /v1/bdbs/stats/last
With metrics filter
GET /v1/bdbs/stats/last?metrics=no_of_keys,used_memory
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| metrics | string | Comma-separated list of metric names for which we want statistics (default is all). (optional) |
Returns [statistics]({{< relref "/operate/rs/references/rest-api/objects/statistics" >}}) for all databases.
Without metrics filter (returns all metrics by default)
{
"1": {
"stime": "2015-05-28T08:06:37Z",
"etime": "2015-05-28T08:06:44Z",
"conns": 0.0,
"egress_bytes": 0.0,
"etime": "2015-05-28T08:06:44Z",
"evicted_objects": 0.0,
"expired_objects": 0.0,
"ingress_bytes": 0.0,
"instantaneous_ops_per_sec": 0.0,
"last_req_time": "1970-01-01T00:00:00Z",
"last_res_time": "1970-01-01T00:00:00Z",
"used_memory": 5651336.0,
"mem_size_lua": 35840.0,
"monitor_sessions_count": 0.0,
"no_of_keys": 0.0,
"other_req": 0.0,
"other_res": 0.0,
"read_hits": 0.0,
"read_misses": 0.0,
"read_req": 0.0,
"read_res": 0.0,
"total_connections_received": 0.0,
"total_req": 0.0,
"total_res": 0.0,
"write_hits": 0.0,
"write_misses": 0.0,
"write_req": 0.0,
"write_res": 0.0
},
"2": {
"stime": "2015-05-28T08:06:37Z",
"etime": "2015-05-28T08:06:44Z",
"// additional fields..."
},
"// Additional BDBs..."
}
With metrics filter
{
"1": {
"etime": "2015-05-28T08:06:44Z",
"used_memory": 5651576.0,
"no_of_keys": 0.0,
"stime": "2015-05-28T08:06:37Z"
},
"2": {
"etime": "2015-05-28T08:06:44ZZ",
"used_memory": 5651440.0,
"no_of_keys": 0.0,
"stime": "2015-05-28T08:06:37Z"
},
"// Additional BDBs.."
}
| Code | Description |
|---|---|
| 200 OK | No error |
| 404 Not Found | No bdbs exist |
GET /v1/bdbs/stats/last/{int: uid}
Get the most recent statistics for a specific database.
| Permission name | Roles |
|---|---|
| [view_bdb_stats]({{< relref "/operate/rs/references/rest-api/permissions#view_bdb_stats" >}}) | admin |
| cluster_member | |
| cluster_viewer | |
| db_member | |
| db_viewer | |
| user_manager |
GET /v1/bdbs/stats/last/1?metrics=no_of_keys,used_memory
| Key | Value | Description |
|---|---|---|
| Host | cnm.cluster.fqdn | Domain name |
| Accept | application/json | Accepted media type |
| Field | Type | Description |
|---|---|---|
| uid | integer | The unique ID of the requested BDB. |
| Field | Type | Description |
|---|---|---|
| metrics | string | Comma-separated list of metric names for which we want statistics (default is all). (optional) |
Returns the most recent [statistics]({{< relref "/operate/rs/references/rest-api/objects/statistics" >}}) for a specific database.
{
"1": {
"etime": "2015-06-23T12:05:08Z",
"used_memory": 5651576.0,
"no_of_keys": 0.0,
"stime": "2015-06-23T12:05:03Z"
}
}
| Code | Description |
|---|---|
| 200 OK | No error |
| 404 Not Found | bdb does not exist |
| 406 Not Acceptable | bdb isn't currently active |
| 503 Service Unavailable | bdb is in recovery state |