Method Path Description
GET /v1/bdbs/stats Get stats for all databases
GET /v1/bdbs/stats/{uid} Get stats for a specific database

Get all database stats

GET /v1/bdbs/stats

Get statistics for all databases.

Permissions

Permission name Roles
view_all_bdb_stats admin
cluster_member
cluster_viewer
db_member
db_viewer

Request

Example HTTP request

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

Headers

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

Query parameters

Field Type Description
interval string Time interval for 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 all databases.

Example JSON body

[
  {
    "uid": "1",
    "intervals": [
      {
         "interval": "1hour",
         "stime": "2015-05-27T12:00:00Z",
         "etime": "2015-05-28T12:59:59Z",
         "avg_latency": 0.0,
         "conns": 0.0,
         "egress_bytes": 0.0,
         "etime": "2015-05-28T00:00:00Z",
         "evicted_objects": 0.0,
         "expired_objects": 0.0,
         "ingress_bytes": 0.0,
         "instantaneous_ops_per_sec": 0.00011973180076628352,
         "last_req_time": "1970-01-01T00:00:00Z",
         "last_res_time": "1970-01-01T00:00:00Z",
         "used_memory": 5656299.362068966,
         "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
      },
      {
         "interval": "1hour",
         "interval": "1hour",
         "stime": "2015-05-27T13:00:00Z",
         "etime": "2015-05-28T13:59:59Z",
         "avg_latency": 599.08,
         "// additional fields..."
      }
    ]
  },
  {
    "uid": "2",
    "intervals": [
      {
        "interval": "1hour",
        "stime": "2015-05-27T12:00:00Z",
        "etime": "2015-05-28T12:59:59Z",
        "avg_latency": 0.0,
        "// additional fields..."
      },
      {
        "interval": "1hour",
        "stime": "2015-05-27T13:00:00Z",
        "etime": "2015-05-28T13:59:59Z",

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

Status codes

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

Example requests

cURL

$ curl -k -u "[username]:[password]" -X GET
        https://[host][:port]/v1/bdbs/stats?interval=1hour

Python

import requests

url = "https://[host][:port]/v1/bdbs/stats?interval=1hour"
auth = ("[username]", "[password]")

response = requests.request("GET", url, auth=auth)

print(response.text)

Get database stats

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

Get statistics for a specific database.

Permissions

Permission name Roles
view_bdb_stats admin
cluster_member
cluster_viewer
db_member
db_viewer

Request

Example HTTP request

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

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 BDB requested.

Query parameters

Field Type Description
interval string Time interval for 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 a specific database.

Example JSON body

{
  "uid": "1",
  "intervals": [
    {
      "interval": "1hour",
      "stime": "2015-05-27T12:00:00Z",
      "etime": "2015-05-28T12:59:59Z",
      "avg_latency": 0.0,
      "conns": 0.0,
      "egress_bytes": 0.0,
      "evicted_objects": 0.0,
      "pubsub_channels": 0,
      "pubsub_patterns": 0,
      "expired_objects": 0.0,
      "ingress_bytes": 0.0,
      "instantaneous_ops_per_sec": 0.00011973180076628352,
      "last_req_time": "1970-01-01T00:00:00Z",
      "last_res_time": "1970-01-01T00:00:00Z",
      "used_memory": 5656299.362068966,
      "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
    },
    {
      "interval": "1hour",
      "stime": "2015-05-27T13:00:00Z",
      "etime": "2015-05-28T13:59:59Z",
      "// additional fields..."
    }
  ]
}

Status codes

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