Aggregate throughput

GET /api/bng/throughput/recent?range=<r>&step=<s>      read_only

Returns all eight aggregate series in one payload, so a multi-series chart gets
consistent timestamps across every line without correlating separate responses.

Parameter Type Default Rules
range enum 1h One of 5m, 15m, 1h, 6h, 24h, 1w, 1m. Anything else returns 400.
step integer seconds computed Floored at 5 s. A non-integer value silently falls back to the default.

1m means one month (thirty days), not one minute. There is no one-minute
range. This is the single most common misreading of the interface.

The default step targets a sensible point count: roughly 720 points for ranges up
to an hour, and roughly 240 beyond, so a thirty-day query does not return a
half-million points.

{
  "ok": true,
  "range": { "start": 1753000000.0, "end": 1753003600.0, "step": 5 },
  "series": {
    "agg_up_green_bps":  [[1753000000.0, "8122340.0000"], [1753000005.0, "8140021.0000"]],
    "agg_up_yellow_bps": [],
    "agg_up_red_bps":    [],
    "agg_dn_green_bps":  [],
    "agg_dn_yellow_bps": [],
    "agg_dn_red_bps":    [],
    "agg_up_pps":        [],
    "agg_dn_pps":        []
  }
}

All eight keys are always present; a series with no data is an empty array,
never absent. Values are bits per second for the _bps series and packets per
second for the _pps series. Remember that sample values are strings.

A sample is emitted for a target timestamp only if the stored sample is within
two steps of it. A gap wider than that produces missing points rather than a
flat line
, so a collection outage is visibly a gap in the data.

The single 400 is {"ok": false, "error": "unknown range"}.