Skip to main content

Module http_viewer_sysinfo

Module http_viewer_sysinfo 

Source
Expand description

This computer’s CPU and memory for a paired device’s Sysinfo, read-only (agentmux-mobile’s PLAN_CHANNEL_AS_ONE_LIST_2026_10_13 §3a):

  • GET /agentmux/viewer/sysinfo: the latest sample, a TimeSeriesData ({ts, values, uptime_secs}, the metric names the desktop’s Sysinfo reads: cpu, cpu:N, mem:*, net:*, disk:*). 204 before the first sample.
  • GET /agentmux/viewer/sysinfo/feed?since=<ms>: the same as SSE, one sample event per sample, its id its ts: first the kept history after since (or after Last-Event-ID; all of it with neither), then each new sample, with a heartbeat on a quiet stream.

Both read the samples the sysinfo loop already keeps (Broker::read_event_history), so a phone watching costs no extra sampling. Built on REPORT_SYSINFO_REWRITE_AND_MODERN_MONITOR_2026_10_13’s data layer as agreed with its author: when that layer’s shared scheduler and since seq N read exist, the feed holds a lease while open and resumes by sequence, and since=<ms> keeps working.

Structs§

SysinfoFeedQuery 🔒
SysinfoTiming 🔒
A Sysinfo feed’s clocks.

Constants§

GLOBAL_SCOPE 🔒
The samples kept for the whole computer (the sysinfo loop also files them under its connection’s scope; the unscoped ring holds them all).
HISTORY_READ 🔒
The most samples kept, and so the most a feed sends first.
POLL_READ 🔒
The most samples one poll reads back. More than a poll can miss even when the loop runs at its fastest (0.2 s) through a long stall.
SAMPLE_POLL 🔒
How often the feed looks for new samples: the sysinfo loop’s own cadence.

Functions§

handle_viewer_sysinfo 🔒
handle_viewer_sysinfo_feed 🔒
history_after 🔒
The kept samples a resume asks for: those after since, by their time. All of them with no since, or when every kept sample is older than it (the computer’s clock went back since the device’s last one).
sample_event 🔒
samples 🔒
One kept sample, as (ts, the TimeSeriesData as sent).
samples_after 🔒
The samples kept after cursor (the last one sent), by their place in the ring, not their time: a clock that goes back doesn’t hide new ones. The newest POLL_READ usually hold it; when they don’t (a stalled stream), the whole ring is read, so nothing kept is skipped. A cursor no longer kept means everything kept is newer.
sysinfo_stream 🔒
The kept samples after since (all of them with none), then each new one; a heartbeat when nothing new came for timing.heartbeat. Ends when the device is revoked or goes away.