HTTP Status

Reports about the performance and configuration of the Riak node to which it was requested. You must have the {riak_kv_stat,true} configuration setting in app.config for this endpoint to be active.

Performance

Repeated requests to the /stats endpoint do not have a negative performance impact as the statistics are cached internally in Riak.

Request

GET /stats

Important headers:

  • Accept - determines whether the response will be formatted in application/json or text/plain.

Response

Normal status codes: * 200 OK

Typical error codes: * 404 Not Found - if riak_kv_stat is not enabled

Important headers: * Content-Type - application/json or text/plain (JSON with added line-breaks)

Example

$ curl -v http://127.0.0.1:8098/stats -H "Accept: text/plain"
* About to connect() to 127.0.0.1 port 8098 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 8098 (#0)
> GET /stats HTTP/1.1
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
> Host: 127.0.0.1:8098
> Accept: text/plain
>
< HTTP/1.1 200 OK
< Vary: Accept, Accept-Encoding
< Server: MochiWeb/1.1 WebMachine/1.9.0 (participate in the frantic)
< Date: Fri, 30 Sep 2011 15:24:35 GMT
< Content-Type: text/plain
< Content-Length: 2102
<
{
    "vnode_gets": 0,
    "vnode_puts": 0,
    "read_repairs": 0,
    "vnode_gets_total": 0,
    "vnode_puts_total": 0,
    "node_gets": 0,
    "node_gets_total": 0,
    "node_get_fsm_time_mean": "undefined",
    "node_get_fsm_time_median": "undefined",
    "node_get_fsm_time_95": "undefined",
    "node_get_fsm_time_99": "undefined",
    "node_get_fsm_time_100": "undefined",
    "node_puts": 0,
    "node_puts_total": 0,
    "node_put_fsm_time_mean": "undefined",
    "node_put_fsm_time_median": "undefined",
    "node_put_fsm_time_95": "undefined",
    "node_put_fsm_time_99": "undefined",
    "node_put_fsm_time_100": "undefined",
    "read_repairs_total": 0,
    "cpu_nprocs": 84,
    "cpu_avg1": 251,
    "cpu_avg5": 174,
    "cpu_avg15": 110,
    "mem_total": 7946684000.0,
    "mem_allocated": 4340880000.0,
    "nodename": "riak@127.0.0.1",
    "connected_nodes": [

    ],
    "sys_driver_version": "1.5",
    "sys_global_heaps_size": 0,
    "sys_heap_type": "private",
    "sys_logical_processors": 2,
    "sys_otp_release": "R13B04",
    "sys_process_count": 189,
    "sys_smp_support": true,
    "sys_system_version": "Erlang R13B04 (erts-5.7.5) [[source]] [[64-bit]] [[smp:2:2]] [[rq:2]] [[async-threads:5]] [[hipe]] [[kernel-poll:true]]",
    "sys_system_architecture": "i386-apple-darwin10.3.0",
    "sys_threads_enabled": true,
    "sys_thread_pool_size": 5,
    "sys_wordsize": 8,
    "ring_members": [
        "riak@127.0.0.1"
    ],
    "ring_num_partitions": 64,
    "ring_ownership": "[{'riak@127.0.0.1',64}]",
    "ring_creation_size": 64,
    "storage_backend": "riak_kv_bitcask_backend",
    "pbc_connects_total": 0,
    "pbc_connects": 0,
    "pbc_active": 0,
    "riak_kv_version": "0.11.0",
    "riak_core_version": "0.11.0",
    "bitcask_version": "1.0.1",
    "luke_version": "0.1",
    "webmachine_version": "1.7.1",
    "mochiweb_version": "1.7.1",
    "erlang_js_version": "0.4",
    "runtime_tools_version": "1.8.3",
    "crypto_version": "1.6.4",
    "os_mon_version": "2.9.1",
    "sasl_version": "2.1.9",
    "stdlib_version": "1.16.5",
    "kernel_version": "2.13.5"
}
* Connection #0 to host 127.0.0.1 left intact
* Closing connection #0

Output Explanation

The output of /stats contains the output of riak admin status detailed in the Inspecting a Node doc, plus the below stats generated by the Riak Core application.

Stat Description
riak_core_stat_ts The last time (in Epoch time) Riak Core stats were generated
ignored_gossip_total Total number of ignored gossip messages since node was started
rings_reconciled_total Total number of ring reconciliation operations since node was started
rings_reconciled Number of ring reconciliation operations in the last minute
gossip_received Number of gossip messages received in the last minute
rejected_handoffs Total number of ownership handoff operations rejected by the node since it was started
handoff_timeouts Total number of handoff timeouts encountered by this node since it was started
dropped_vnode_requests_total Total number of requests dropped by local vnodes since the node was started
converge_delay_min Minimum time in milliseconds describing time taken for the ring to converge after ring changes
converge_delay_max Maximum time in milliseconds describing time taken for the ring to converge after ring changes
converge_delay_mean Mean time in milliseconds describing time taken for the ring to converge after ring changes
converge_delay_last Last observed histogram value in milliseconds describing time taken for the ring to converge after ring changes
rebalance_delay_min Minimum time in milliseconds taken to calculate partition rebalance during a cluster membership change
rebalance_delay_max Maximum time in milliseconds taken to calculate partition rebalance during a cluster membership change
rebalance_delay_mean Mean time in milliseconds describing time taken for the ring to converge after ring changes
rebalance_delay_last Last observed histogram value in milliseconds describing time taken for the ring to converge after ring changes
riak_kv_vnodes_running Number of local Riak KV virtual nodes running
riak_kv_vnodeq_min Minimum queue size of all local Riak KV virtual nodes in the last minute
riak_kv_vnodeq_median Median queue size of all local Riak KV virtual nodes in the last minute
riak_kv_vnodeq_mean Mean queue size of all local Riak KV virtual nodes in the last minute
riak_kv_vnodeq_max Max queue size of all local Riak KV virtual nodes in the last minute
riak_kv_vnodeq_total Total queue size of all local Riak KV virtual nodes in the last minute
riak_pipe_vnodes_running Number of local Riak Pipe virtual nodes running
riak_pipe_vnodeq_min Minimum queue size of local Riak Pipe virtual nodes in the last minute
riak_pipe_vnodeq_median Median queue size of local Riak Pipe virtual nodes in the last minute
riak_pipe_vnodeq_mean Mean queue size of local Riak Pipe virtual nodes in the last minute
riak_pipe_vnodeq_max Max queue size of local Riak Pipe virtual nodes in the last minute
riak_pipe_vnodeq_total Total queue size of all local Riak Pipe virtual nodes in the last minute