simvx.graphics.streaming._drops

Accounting for items the streaming server discards under back-pressure.

Module Contents

Classes

DropCounter

Counts discarded items and warns at most once per interval.

Data

log

__all__

DEFAULT_LOG_INTERVAL

Seconds between drop warnings.

API

simvx.graphics.streaming._drops.log

‘getLogger(…)’

simvx.graphics.streaming._drops.__all__

[‘DropCounter’]

simvx.graphics.streaming._drops.DEFAULT_LOG_INTERVAL

5.0

Seconds between drop warnings.

class simvx.graphics.streaming._drops.DropCounter(label: str, interval: float = DEFAULT_LOG_INTERVAL)

Counts discarded items and warns at most once per interval.

A saturated queue discards on every push, so a line per drop would itself flood the log. Warnings are batched instead: the first drop reports at once, then at most one line every interval seconds, carrying the number of drops since the previous line and the running total.

Initialization

property total: int

Items discarded since this counter was created.

record() None

Count one discarded item, warning if the rate limit allows.