Traffic
- async OPNsenseClient.get_interface_traffic()
Return a normalized diagnostics traffic snapshot.
- async OPNsenseClient.stream_interface_traffic(poll_interval=1)
Yield normalized diagnostics traffic stream samples.
- Parameters:
poll_interval (int) – Requested stream interval in seconds. Values below 1 are clamped to 1, and the clamped value selects the stream endpoint.
- Yields:
dict[str, Any] –
- Normalized traffic samples after the initial valid timing
event is discarded because it cannot represent an interval delta. Later samples use elapsed time between strictly increasing server timestamps; after a timing reset, the next valid sample uses the selected stream interval. The stream ends empty when checking the stream endpoint fails; with
throw_errorsenabled, that failure is raised as anOPNsenseErrorsubclass instead.
- Return type:
AsyncIterator[dict[str, Any]]