Generic monitor process: drives a Sys.Mon.Sampler on a fixed period, folds
each reading through a Controls.Ewma low-pass filter, and answers value/1.
Ticks self-schedule with Process.send_after after each sample completes, so
a slow sample cannot let ticks pile up. dt for the filter is measured with
System.monotonic_time/1, so the EWMA gain stays correct under jitter.
Summary
Functions
Returns a specification to start this module under a supervisor.
Force a single synchronous sample and return the resulting reading. Mainly for tests.
Start the monitor for sampler, registered under the sampler's own module name.
The latest instantaneous + filtered reading.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec sample_now(GenServer.server()) :: Sys.Mon.Server.Reading.t()
Force a single synchronous sample and return the resulting reading. Mainly for tests.
@spec start_link(module()) :: GenServer.on_start()
Start the monitor for sampler, registered under the sampler's own module name.
The sampler module fully describes the monitor: Sys.Mon.Server reads its
schedule from period/0 and tau/0.
@spec value(GenServer.server()) :: Sys.Mon.Server.Reading.t()
The latest instantaneous + filtered reading.