1# @ajax/mesh-samplers
23meshd's two once-a-second samplers: the load telemetry (machine and programs) and the network interfaces.
45meshd's two sampler threads.
67- load (load.rs `sampler`): every second, this machine's host sample and
8every loaded program's (mesh-load-host, mesh-load-prog) into the host
9block's load regions and the mailbox's LOAD_PAGE; in a fleet, the member
10summary to every member (F_LOADREP) and the scheduler's report (F_PERF,
11through the fleet's hook).
12- net (net.rs `sampler`): every second, the interfaces that carry (or
13carried) a peer link, and the total, into the host block's NIC records.
1415Both run until sh->quit; a host that cannot be read is said once per distinct error, and the sample's age shows it to viewers.
1617```c
18#include "mesh/samplers.h"
19```
2021## Ported from
2223[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): crates/mesh-host/src/load.rs `sampler`; crates/mesh-host/src/net.rs `sampler`.
2425## Tests
2627- `tests/samplers.c`: both run on this machine for a few seconds: load samples, CPUs, memory, a program's record, the load page, NIC samples and the total; both stop on quit.
2829## Differences
3031- The fleet's scheduler report (`perf_report`, F_PERF) goes through the `mesh_load_perf` hook the fleet area sets; F_LOADREP is broadcast here.
3233## Licence
3435MIT. See the repository's LICENSE.