skip to content
==> include/mesh/samplers.h <==
1/* @ajax/mesh-samplers: meshd's two sampler threads.
2 *
3 * - load (load.rs `sampler`): every second, this machine's host sample and
4 *   every loaded program's (mesh-load-host, mesh-load-prog) into the host
5 *   block's load regions and the mailbox's LOAD_PAGE; in a fleet, the member
6 *   summary to every member (F_LOADREP) and the scheduler's report (F_PERF,
7 *   through the fleet's hook).
8 * - net (net.rs `sampler`): every second, the interfaces that carry (or
9 *   carried) a peer link, and the total, into the host block's NIC records.
10 *
11 * Both run until sh->quit; a host that cannot be read is said once per
12 * distinct error, and the sample's age shows it to viewers. */
13#ifndef MESH_SAMPLERS_H
14#define MESH_SAMPLERS_H
15
16#include "mesh/abi.h"
17#include "mesh/load_host.h"
18#include "mesh/shared.h"
19
20#include <stdbool.h>
21#include <stddef.h>
22#include <stdint.h>
23
24void mesh_load_sampler(mesh_shared *sh);
25void mesh_net_sampler(mesh_shared *sh);
26
27/* The fleet's scheduler report (F_PERF) built from a sample and broadcast
28 * (load.rs perf_report and its frame); set by meshd in a fleet. NULL: none. */
29extern void (*mesh_load_perf)(mesh_shared *sh, const mesh_host_sample *h, const uint8_t *cls, size_t ncls, const uint8_t (*recs)[MESH_PLOAD_BYTES],
30                              size_t n);
31
32#endif