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.
- static from_s(period_s: float, **kwargs) RateLimiter [source]#
Create a rate limiter from seconds.
- 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.
- property skips: int#
Get the number of accumulated skips (due to rate limiting).
Module contents#
A module for analyzing data rates in the time domain.
- class vcorelib.math.analysis.rate.RateTracker(source: ~typing.Callable[[], int] = <function default_time_ns>, **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.
- property value: float#
An accessor for the underlying value.