MethodPathDescription
GET/v1/bdbs/statsGet 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 nameRoles
view_all_bdb_statsadmin
cluster_member
cluster_viewer
db_member
db_viewer

Request

Example HTTP request

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

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Query parameters

FieldTypeDescription
intervalstringTime interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional)
stimeISO_8601Start time from which we want the stats. Should comply with the ISO_8601 format (optional)
etimeISO_8601End 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

CodeDescription
200 OKNo error
404 Not FoundNo 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 nameRoles
view_bdb_statsadmin
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

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the BDB requested.

Query parameters

FieldTypeDescription
intervalstringTime interval for for which we want stats: 1sec/10sec/5min/15min/1hour/12hour/1week (optional)
stimeISO_8601Start time from which we want the stats. Should comply with the ISO_8601 format (optional)
etimeISO_8601End 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

CodeDescription
200 OKNo error
404 Not Foundbdb does not exist
406 Not Acceptablebdb isn’t currently active
503 Service Unavailablebdb is in recovery state