Repository navigation
Conversation
The agent reads /proc/stat, /proc/net/dev and /proc/uptime once a pass and reports, since the previous pass, how busy the CPUs were (busy, iowait and steal as shares of all CPUs) and the bytes per second at the physical interfaces. Rates span readings taken by uptime, so they hold across clock steps and missed passes, and are null on a first pass, across more than ten minutes, or without a physical interface. Nothing else is read; a counter that cannot be read is logged and left null, without making the host's subjects unobserved. Parsing never panics on input. The unit restarts the agent at most once a minute: a restart is a full first pass. skym report --dry-run measures the rates over the second before it. The hosts tab shows CPUs and busy %; a host's preview and page add cpu (busy, iowait, steal from 1%, load) and net lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 2 of richer collection, iteration 1 of 3: host CPU and network. These come only from kernel counters, under the constraint that collection must stay lightweight and must never affect the host.
What the agent reads
/proc/stat(thecpuline, first 8 fields)/proc/net/dev/sys/class/net/<if>/device), so bonds, bridges and container interfaces are not counted twice/proc/uptimedocker stats, noexec.Safety
nullon the first pass, across more than ten minutes, after a reboot (uptime went back), or when no interface is present in both readings.host::read, so load, memory and disks are unaffected.warning: host: /proc/…) and left null.Report.errors, which would make the server treat the host's endpoints and log hygiene as unobserved. This changes the design, following the review: a purely informational metric must not affect incident lifecycles.deploy/skym.servicenow hasRestartSec=60. A restart is a full first pass (every container, an hour of events), so even a crash loop costs no more than normal passes.Protocol
These fields are additive with
serde(default), and there is no migration:HostState:cpu_percent,iowait_percent,steal_percent,net_rx_bytes_per_s,net_tx_bytes_per_s.HostOverviewcarries the same fields.null.View
4 · 23%; with no rate yet, only the core count.stealis shown only from 1%.Verification
257 tests pass; clippy and fmt are clean.
cargo-mutants on the diff: 93 mutants, none missed. The real-system reads (
counters,physical_interfaces,read_parsed) are excluded.skym report --dry-runwas run read-only, from/tmp, as theskymuser, on sp (1 CPU), i (the busiest) and h129 (CentOS 8, cgroup v1). It measures over the second before the pass.cpu_percentNetwork values were of the order a manual read gives (different seconds). The test binaries were removed afterwards.
An independent review found no panic path. Fixed from it:
Rollout
CPUUsageNSecandMemoryCurrentbefore and after, and watch for 30 minutes.skym.prevfor rollback.skym-view.Next: iteration 2 (container CPU on cgroup v2 and v1, plus container memory on v1), then iteration 3 (addresses, listening sockets, top processes), each with its own design and review.