You can use the REST API to get statistics with the at the bucket level from Couchbase Server. Your request URL should be taken from stats.uri property of a bucket response. By default this request returns stats samples for the last minute and for heavily used keys. You use provide additional query parameters in a request to get a more detailed level of information:
zoom - stats zoom level (minute | hour | day | week | month | year)
resampleForUI - pass 1 if you need 60 samples
haveTStamp - request sending only samples newer than given timestamp
GET /pools/default/stats Host: localhost:8091 Authorization: Basic xxxxxxxxxxxxxxxxxxx Accept: application/json X-memcachekv-Store-Client-Specification-Version: 0.1
HTTP/1.1 200 OK Content-Type: application/json Content-Length: nnn { "op": { "samples": { "hit_ratio": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "ep_cache_miss_rate": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ..... "samplesCount": 60, "isPersistent": true, "lastTStamp":513777166.0, "interval": 1000 }, "hot_keys": [ { "name": "48697", "ops": 0.0009276437847866419 }, { "name": "8487", "ops": 0.0009276437847866419 }, { "name": "77262", "ops": 0.0009276437847866419 }, { "name": "58495", "ops": 0.0009276437847866419 }, { "name": "21003", "ops": 0.0009276437847866419 }, { "name": "26850", "ops": 0.0009276437847866419 }, { "name": "73717", "ops": 0.0009276437847866419 }, { "name": "86218", "ops": 0.0009276437847866419 }, { "name": "80344", "ops": 0.0009276437847866419 }, { "name": "83457", "ops": 0.0009276437847866419 } ] } }