CHAOS/API Reference/Statistics

Get link statistics

gethttp://localhost/v1/impairments/{direction}/stats

Served over the Unix socket /run/chaosd/chaosd.sock

Returns a LinkStats sample of cumulative egress counters from the managed root qdisc, with monotonic and wall-clock sample timestamps.

The wire shape never carries rates. Poll this endpoint and compute throughput, packets per second, and drop rate from the delta between two samples.

Path parameters

directionstringRequired

The direction to operate on. Each direction is configured independently. An unknown value returns 400.

Allowedport1port2

Response

200 · application/json

Statistics sample. Returns a LinkStats object.

directionstringOptional
Allowedport1port2
tx_bytesinteger <int64>Optional

Total bytes sent through the qdisc.

tx_packetsinteger <int64>Optional

Total packets sent through the qdisc.

droppedinteger <int64>Optional

Packets dropped: queue overflow plus impairment loss.

overlimitsinteger <int64>Optional

Times the qdisc exceeded its rate ceiling (tbf).

requeuesinteger <int64>Optional

Packets requeued.

backlog_bytesintegerOptional

Bytes currently enqueued.

backlog_packetsintegerOptional

Packets currently enqueued.

captured_atinteger <int64>Optional

Monotonic sample time in nanoseconds.

captured_at_wallinteger <int64>Optional

Wall-clock sample time in nanoseconds since the Unix epoch.

Errors

400
Problem

Unknown direction or malformed body.

500
Problem

Backend or I/O error.