getStats

Returns statistics snapshots within a provided timestamp range.


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/_getStats[?startTime=<Epoch-millis>][&stopTime=<Epoch-millis>]
Method: GET

Other protocols

Copied to clipboard!
{
  "controller": "server",
  "action": "getStats",
  "startTime": <timestamp>,
  "stopTime": <timestamp>
}

Response

Returns the found statistic snapshots in the following format:

  • hits: array of statistic snapshots. By default, snapshots are made every 10 seconds and they are stored for 1 hour. Each snapshot is an object with the following properties:
    • completedRequests: completed requests, per network protocol
    • connections: number of active connections, per network protocol
    • failedRequests: failed requests, per network protocol
    • ongoingRequests: requests underway, per network protocol
    • timestamp: snapshot timestamp, in Epoch-millis format
  • total: total number of available snapshots
Copied to clipboard!
{
  "status": 200,
  "error": null,
  "action": "getStats",
  "controller": "server",
  "requestId": "<unique request identifier>",
  "result": {
    "total": 1,
    "hits": [
      {
        "completedRequests": {
          "websocket": 148,
          "http": 24,
          "mqtt": 78
        },
        "failedRequests": {
          "websocket": 3
        },
        "ongoingRequests": {
          "mqtt": 8,
          "http": 2
        }
        "connections": {
          "websocket": 13
        },
        "timestamp": 1453110641308
      }
    ]
  }
}