Skip to content

Event Stats

Rishabh edited this page Apr 7, 2015 · 1 revision

The stats operation provides statistical values for a numeric data type. This operation is useful for deriving useful statistics from commonly available data like API response times, API response sizes etc.

Stats available

  • min
  • max
  • mean
  • count
  • standard deviation
  • sum
  • variance
  • sum of squares
  • percentiles - 1, 5, 25, 50, 75, 95, 99

Request Parameters

  • opcode - stats (Required) - Operation code for this analytics
  • table - table_name (Required) - Table on which analytics will be run
  • filters - Array of filters (Optional) (default - no filters)
  • field - Numeric field on which stats will be calculated (Required)

Sample Request

{
    "opcode": "stats",
    "table": "europa",
    "filters": [],
    "field": "duration"
}

Sample Response

{
    "opcode": "stats",
    "result": {
        "stats": {
            "min": -1079,
            "max": 1428394427813,
            "count": 828720612,
            "std_deviation": 870157206.9001659,
            "sum": 439640922737223,
            "variance": 757173564720298100,
            "sum_of_squares": 6.27485573177197e+26,
            "avg": 530505.596664492
        },
        "percentiles": {
            "99.0": 168.35183367430537,
            "25.0": 2.000000070291734,
            "75.0": 27,
            "1.0": 0,
            "95.0": 103,
            "50.0": 11.91180654980916,
            "5.0": 1
        }
    }
}