# `Sys.Mon.Server`
[🔗](https://github.com/harmont-dev/hyper/blob/main/lib/sys/mon/server.ex#L1)

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.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `sample_now`

```elixir
@spec sample_now(GenServer.server()) :: Sys.Mon.Server.Reading.t()
```

Force a single synchronous sample and return the resulting reading. Mainly for tests.

# `start_link`

```elixir
@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`.

# `value`

```elixir
@spec value(GenServer.server()) :: Sys.Mon.Server.Reading.t()
```

The latest instantaneous + filtered reading.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
