vcorelib.math.analysis.rate package#

Submodules#

vcorelib.math.analysis.rate.limiter module#

A module for simplifying limiting the rate of a function call or hot loop.

class vcorelib.math.analysis.rate.limiter.RateLimiter(period_ns: int, **kwargs)[source]#

Bases: object

A class for limiting the rate of runtime work.

property rate_hz: float#

Get the underlying rate that this limiter is governing. This is useful to determine if the rate limitation is or isn’t impacting the rate of some task.

Module contents#

A module for analyzing data rates in the time domain.

class vcorelib.math.analysis.rate.RateTracker(**kwargs)[source]#

Bases: object

A class for managing rate information for some data channel.

measure(value: float = 1.0, timer: ~vcorelib.math.time.Timer = <vcorelib.math.time.Timer object>) Iterator[None][source]#

Track the time that the caller’s context takes.

poll(time_ns: int = None) float[source]#

Siphon accumulated time and update rate tracking.

reset() None[source]#

Reset this rate tracker.

property value: float#

An accessor for the underlying value.

with_dt(delta_s: float, value: float = 1.0) None[source]#

Update this rate by directly providing the delta-time value.