A newer version of this documentation is available.

View Latest

Getting Bucket Statistics

    +
    To retrieve bucket statistics, use the GET operation with the /pools/default/buckets/bucket_name/stats URI.

    HTTP method and URI

    Statistics can be retrieved at the bucket level. The request URL should be taken from stats.uri property of a bucket response. By default, this request returns stats for the last minute and for heavily used keys. Query parameters provide a more detailed level of information.

    GET /pools/default/buckets/[bucket-name]/stats

    Parameters:

    zoom

    Provides a statistical sampling for that bucket stats at a particular interval (minute | hour | day | week | month | year). For example, a zoom level of minute provides bucket statistics from the past minute, a zoom level of day provides bucket statistics for the past day, and so on. If no zoom level is provided, the server returns statistics from the past minute.

    haveTStamp

    Requests statistics from this timestamp until the current time. The timestamp is specified as UNIX epoch time.

    The zoom parameter provides the following granularity:

    • zoom=minute - Every second for the last minute (60 samples).

    • zoom=hour - Every four (4) seconds for the last hour (900 samples).

    • zoom=day - Every minute for the last day (1440 samples).

    • zoom=week - Every ten (10) minutes for the last week, actually, eight (8) days (1152 samples).

    • zoom=year - Every six (6) hours for the last year (1464 samples).

    Due to sample frequency, the number of samples returned are plus or minus one (+-1).

    To limit the results when using the zoom parameter, post-process the results. For example, if you need samples from the last five (5) minutes, set the zoom parameter to one hour and retrieve the last 75 entries from the JSON list.

    Syntax

    Curl request syntax:

    curl -u [admin]:[password] http://[localhost]:8091/pools/default/buckets/[bucket-name]/stats

    Raw HTTP request syntax:

    GET /pools/default/buckets/[bucket-name]/stats
    Host: [localhost]:8091
    Authorization: Basic xxxxxxxxxxxxxxxxxxx
    Accept: application/json X-memcachekv-Store-Client-Specification-Version: 0.1

    Example: stats

    Curl request example with no parameters:

    curl -u Administrator:password http://10.5.2.54:8091/pools/default/buckets/test-bucket/stats

    Response

    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
                }
            ]
        }
    }

    Example: zoom parameter

    The following example retrieves sample statistics from a bucket for the last minute.

    curl -X GET -u admin:password -d zoom=minute http://localhost:8091/pools/default/buckets/bucket-name/stats

    The following example retrieves sample statistics from a bucket for the past day.

    curl -X GET -u admin:password -d zoom=day http://localhost:8091/pools/default/buckets/bucket-name/stats

    The following example retrieves sample statistics from a bucket for the last month.

    curl -X GET -u admin:password -d zoom=month http://localhost:8091/pools/default/buckets/bucket-name/stats

    Response

    Sample output for each of these requests appears in the same format and with the same fields. Depending on the level of bucket activity, there may be more detail for each field or less. In this sample output, results for each category are omitted.

    {
      "hot_keys": [],
      "op": {
        "interval": 1000,
        "lastTStamp": 1376963580000,
        "isPersistent": true,
        "samplesCount": 1440,
        "samples": {
          "timestamp": [1376955060000, 1376955120000, 1376955180000, 1376955240000, ... ],
          "xdc_ops": [0, 0, 0, 0, ... ],
          "vb_total_queue_age": [0, 0, 0, 0, ... ],
          "vb_replica_queue_size": [0, 0, 0, 0, ... ],
          "vb_replica_queue_fill": [0, 0, 0, 0, ... ],
          "vb_replica_queue_drain": [0, 0, 0, 0, ... ],
          "vb_replica_queue_age": [0, 0, 0, 0, ... ],
          "vb_replica_ops_update": [0, 0, 0, 0, ... ],
          "vb_replica_ops_create": [0, 0, 0, 0, ... ],
          "vb_replica_num_non_resident": [0, 0, 0, 0, ... ],
          "vb_replica_num": [0, 0, 0, 0, ... ],
          "vb_replica_meta_data_memory": [0, 0, 0, 0, ... ],
          "vb_replica_itm_memory": [0, 0, 0, 0, ... ],
          "vb_replica_eject": [0, 0, 0, 0, ... ],
          "vb_replica_curr_items": [0, 0, 0, 0, ... ],
          "vb_pending_queue_size": [0, 0, 0, 0, ... ],
          "vb_pending_queue_fill": [0, 0, 0, 0, ... ],
          "vb_pending_queue_drain": [0, 0, 0, 0, ... ],
          "vb_pending_queue_age": [0, 0, 0, 0, ... ],
          "vb_pending_ops_update": [0, 0, 0, 0, ... ],
          "vb_pending_ops_create": [0, 0, 0, 0, ... ],
          "vb_pending_num_non_resident": [0, 0, 0, 0, ... ],
          "vb_pending_num": [0, 0, 0, 0, ... ],
          "vb_pending_meta_data_memory": [0, 0, 0, 0, ... ],
          "vb_pending_itm_memory": [0, 0, 0, 0, ... ],
          "vb_pending_eject": [0, 0, 0, 0, ... ],
          "vb_pending_curr_items": [0, 0, 0, 0, ... ],
          "vb_active_queue_size": [0, 0, 0, 0, ... ],
          "vb_active_queue_fill": [0, 0, 0, 0, ... ],
          "vb_active_queue_drain": [0, 0, 0, 0, ... ],
          "vb_active_queue_age": [0, 0, 0, 0, ... ],
          "vb_active_ops_update": [0, 0, 0, 0, ... ],
          "vb_active_ops_create": [0, 0, 0, 0, ... ],
          "vb_active_num_non_resident": [0, 0, 0, 0, ... ],
          "vb_active_num": [1024, 1024, 1024, 1024, ... ],
          "vb_active_meta_data_memory": [0, 0, 0, 0, ... ],
          "vb_active_itm_memory": [0, 0, 0, 0, ... ],
          "vb_active_eject": [0, 0, 0, 0, ... ],
          "ep_ops_create": [0, 0, 0, 0, ... ],
          "ep_oom_errors": [0, 0, 0, 0, ... ],
          "ep_num_value_ejects": [0, 0, 0, 0, ... ],
          "ep_num_ops_set_ret_meta": [0, 0, 0, 0, ... ],
          "ep_num_ops_set_meta": [0, 0, 0, 0, ... ],
          "ep_num_ops_get_meta": [0, 0, 0, 0, ... ],
          "ep_num_ops_del_ret_meta": [0, 0, 0, 0, ... ],
          "ep_num_ops_del_meta": [0, 0, 0, 0, ... ],
          "ep_num_non_resident": [0, 0, 0, 0, ... ],
          "ep_meta_data_memory": [0, 0, 0, 0, ... ],
          "ep_mem_low_wat": [402653184, 402653184, 402653184, 402653184, ... ],
          "ep_mem_high_wat": [456340275, 456340275, 456340275, 456340275, ... ],
          "ep_max_data_size": [536870912, 536870912, 536870912, 536870912, ... ],
          "ep_kv_size": [0, 0, 0, 0, ... ],
          "ep_item_commit_failed": [0, 0, 0, 0, ... ],
          "ep_flusher_todo": [0, 0, 0, 0, ... ],
          "ep_diskqueue_items": [0, 0, 0, 0, ... ],
          "ep_diskqueue_fill": [0, 0, 0, 0, ... ],
          "ep_diskqueue_drain": [0, 0, 0, 0, ... ],
          "ep_bg_fetched": [0, 0, 0, 0, ... ],
          "disk_write_queue": [0, 0, 0, 0, ... ],
          "disk_update_total": [0, 0, 0, 0, ... ],
          "disk_update_count": [0, 0, 0, 0, ... ],
          "disk_commit_total": [0, 0, 0, 0, ... ],
          "disk_commit_count": [0, 0, 0, 0, ... ],
          "delete_misses": [0, 0, 0, 0, ... ],
          "delete_hits": [0, 0, 0, 0, ... ],
          "decr_misses": [0, 0, 0, 0, ... ],
          "decr_hits": [0, 0, 0, 0, ... ],
          "curr_items_tot": [0, 0, 0, 0, ... ],
          "curr_items": [0, 0, 0, 0, ... ],
          "curr_connections": [9, 9, 9, 9, ... ],
          "avg_bg_wait_time": [0, 0, 0, 0, ... ],
          "avg_disk_commit_time": [0, 0, 0, 0, ... ],
          "avg_disk_update_time": [0, 0, 0, 0, ... ],
          "vb_pending_resident_items_ratio": [0, 0, 0, 0, ... ],
          "vb_replica_resident_items_ratio": [0, 0, 0, 0, ... ],
          "vb_active_resident_items_ratio": [0, 0, 0, 0, ... ],
          "vb_avg_total_queue_age": [0, 0, 0, 0, ... ],
          "vb_avg_pending_queue_age": [0, 0, 0, 0, ... ],
          "couch_total_disk_size": [8442535, 8449358, 8449392, 8449392, ... ],
          "couch_docs_fragmentation": [0, 0, 0, 0, ... ],
          "couch_views_fragmentation": [0, 0, 0, 0, ... ],
          "hit_ratio": [0, 0, 0, 0, ... ],
          "ep_cache_miss_rate": [0, 0, 0, 0, ... ],
          "ep_resident_items_rate": [100, 100, 100, 100, ... ],
          "vb_avg_active_queue_age": [0, 0, 0, 0, ... ],
          "vb_avg_replica_queue_age": [0, 0, 0, 0, ... ],
          "bg_wait_count": [0, 0, 0, 0, ... ],
          "bg_wait_total": [0, 0, 0, 0, ... ],
          "bytes_read": [103.5379762658911, 103.53627151841438, 103.53627262555834, 103.53739884434893, ... ],
          "bytes_written": [20793.105529503482, 20800.99759272974, 20802.109356966503, 20803.59949917707, ... ],
          "cas_badval": [0, 0, 0, 0, ... ],
          "cas_hits": [0, 0, 0, 0, ... ],
          "cas_misses": [0, 0, 0, 0, ... ],
          "cmd_get": [0, 0, 0, 0, ... ],
          "cmd_set": [0, 0, 0, 0, ... ],
          "couch_docs_actual_disk_size": [8442535, 8449358, 8449392, 8449392, ... ],
          "couch_docs_data_size": [8435712, 8435712, 8435712, 8435712, ... ],
          "couch_docs_disk_size": [8435712, 8435712, 8435712, 8435712, ... ],
          "couch_views_actual_disk_size": [0, 0, 0, 0, ... ],
          "couch_views_data_size": [0, 0, 0, 0, ... ],
          "couch_views_disk_size": [0, 0, 0, 0, ... ],
          "couch_views_ops": [0, 0, 0, 0, ... ],
          "ep_ops_update": [0, 0, 0, 0, ... ],
          "ep_overhead": [27347928, 27347928, 27347928, 27347928, ... ],
          "ep_queue_size": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_count": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_qlen": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_queue_backfillremaining": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_queue_backoff": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_queue_drain": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_queue_fill": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_queue_itemondisk": [0, 0, 0, 0, ... ],
          "ep_tap_rebalance_total_backlog_size": [0, 0, 0, 0, ... ],
          "ep_tap_replica_count": [0, 0, 0, 0, ... ],
          "ep_tap_replica_qlen": [0, 0, 0, 0, ... ],
          "ep_tap_replica_queue_backfillremaining": [0, 0, 0, 0, ... ],
          "ep_tap_replica_queue_backoff": [0, 0, 0, 0, ... ],
          "ep_tap_replica_queue_drain": [0, 0, 0, 0, ... ],
          "ep_tap_replica_queue_fill": [0, 0, 0, 0, ... ],
          "ep_tap_replica_queue_itemondisk": [0, 0, 0, 0, ... ],
          "ep_tap_replica_total_backlog_size": [0, 0, 0, 0, ... ],
          "ep_tap_total_count": [0, 0, 0, 0, ... ],
          "ep_tap_total_qlen": [0, 0, 0, 0, ... ],
          "ep_tap_total_queue_backfillremaining": [0, 0, 0, 0, ... ],
          "ep_tap_total_queue_backoff": [0, 0, 0, 0, ... ],
          "ep_tap_total_queue_drain": [0, 0, 0, 0, ... ],
          "ep_tap_total_queue_fill": [0, 0, 0, 0, ... ],
          "ep_tap_total_queue_itemondisk": [0, 0, 0, 0, ... ],
          "ep_tap_total_total_backlog_size": [0, 0, 0, 0, ... ],
          "ep_tap_user_count": [0, 0, 0, 0, ... ],
          "ep_tap_user_qlen": [0, 0, 0, 0, ... ],
          "ep_tap_user_queue_backfillremaining": [0, 0, 0, 0, ... ],
          "ep_tap_user_queue_backoff": [0, 0, 0, 0, ... ],
          "ep_tap_user_queue_drain": [0, 0, 0, 0, ... ],
          "ep_tap_user_queue_fill": [0, 0, 0, 0, ... ],
          "ep_tap_user_queue_itemondisk": [0, 0, 0, 0, ... ],
          "ep_tap_user_total_backlog_size": [0, 0, 0, 0, ... ],
          "ep_tmp_oom_errors": [0, 0, 0, 0, ... ],
          "ep_vb_total": [1024, 1024, 1024, 1024, ... ],
          "evictions": [0, 0, 0, 0, ... ],
          "get_hits": [0, 0, 0, 0, ... ],
          "get_misses": [0, 0, 0, 0, ... ],
          "incr_hits": [0, 0, 0, 0, ... ],
          "incr_misses": [0, 0, 0, 0, ... ],
          "mem_used": [27347928, 27347928, 27347928, 27347928, ... ],
          "misses": [0, 0, 0, 0, ... ],
          "ops": [0, 0, 0, 0, ... ],
          "replication_active_vbreps": [0, 0, 0, 0, ... ],
          "replication_bandwidth_usage": [0, 0, 0, 0, ... ],
          "replication_changes_left": [0, 0, 0, 0, ... ],
          "replication_commit_time": [0, 0, 0, 0, ... ],
          "replication_data_replicated": [0, 0, 0, 0, ... ],
          "replication_docs_checked": [0, 0, 0, 0, ... ],
          "replication_docs_latency_aggr": [0, 0, 0, 0, ... ],
          "replication_docs_latency_wt": [0, 0, 0, 0, ... ],
          "replication_docs_rep_queue": [0, 0, 0, 0, ... ],
          "replication_docs_written": [0, 0, 0, 0, ... ],
          "replication_meta_latency_aggr": [0, 0, 0, 0, ... ],
          "replication_meta_latency_wt": [0, 0, 0, 0, ... ],
          "replication_num_checkpoints": [0, 0, 0, 0, ... ],
          "replication_num_failedckpts": [0, 0, 0, 0, ... ],
          "replication_rate_replication": [0, 0, 0, 0, ... ],
          "replication_size_rep_queue": [0, 0, 0, 0, ... ],
          "replication_waiting_vbreps": [0, 0, 0, 0, ... ],
          "replication_work_time": [0, 0, 0, 0, ... ]
        }
      }
    }