pub struct SystemSnapshot {Show 16 fields
pub sequence: u64,
pub captured_at: Instant,
pub wall_time: SystemTime,
pub elapsed: Duration,
pub host: HostSnapshot,
pub cpu: CpuSnapshot,
pub memory: MemorySnapshot,
pub load: MetricState<LoadSnapshot>,
pub processes: Vec<ProcessSnapshot>,
pub disks: Vec<DiskSnapshot>,
pub filesystems: Vec<FilesystemSnapshot>,
pub networks: Vec<NetworkSnapshot>,
pub pressure: PressureSnapshot,
pub sensors: SensorSnapshot,
pub capabilities: CapabilitySnapshot,
pub health: CollectorHealth,
}Expand description
One complete, internally consistent observation of the system.
Fields§
§sequence: u64Monotonically increasing sequence number.
Used to detect coalescing and to order snapshots without consulting the wall clock, which can move backwards (§8.1).
captured_at: InstantMonotonic capture time, for rate calculations and ordering (§8.1).
Deliberately an Instant, which is why this type is not Serialize:
export goes through a dedicated DTO that emits wall_time instead.
wall_time: SystemTimeWall-clock capture time, for display and export only.
elapsed: DurationThe actual interval since the previous snapshot.
§8.1 forbids assuming one second. Zero on the first snapshot.
host: HostSnapshotSystem identity.
cpu: CpuSnapshotCPU state.
memory: MemorySnapshotMemory state.
load: MetricState<LoadSnapshot>Load averages.
processes: Vec<ProcessSnapshot>Every process visible to us.
disks: Vec<DiskSnapshot>Block devices.
filesystems: Vec<FilesystemSnapshot>Mounted filesystems. Separate from disks by §7.3.
networks: Vec<NetworkSnapshot>Network interfaces.
pressure: PressureSnapshotPressure Radar.
sensors: SensorSnapshotTemperature and battery.
capabilities: CapabilitySnapshotWhat this platform can and cannot report.
health: CollectorHealthCollector timing and our own overhead.
Implementations§
Source§impl SystemSnapshot
impl SystemSnapshot
Sourcepub fn warming_up(
captured_at: Instant,
wall_time: SystemTime,
logical_cpus: u16,
) -> Self
pub fn warming_up( captured_at: Instant, wall_time: SystemTime, logical_cpus: u16, ) -> Self
The first snapshot: identity is known, every measurement is warming up.
§26: the first sample of delta-based data is not zero. This constructor is what makes that the default rather than something each collector must remember.
Sourcepub fn process(&self, identity: ProcessIdentity) -> Option<&ProcessSnapshot>
pub fn process(&self, identity: ProcessIdentity) -> Option<&ProcessSnapshot>
Looks up a process by stable identity.
Keyed on the full identity rather than the PID, so a reused PID returns
None instead of a different process (§26).
Sourcepub fn process_by_pid(&self, pid: u32) -> Option<&ProcessSnapshot>
pub fn process_by_pid(&self, pid: u32) -> Option<&ProcessSnapshot>
Looks up whatever process currently holds pid, whichever it is.
Only the signal-revalidation path should use this: it needs to discover that a PID has been reused, which requires deliberately ignoring the start key (§6.2).
Sourcepub fn process_count(&self) -> usize
pub fn process_count(&self) -> usize
Total process count, for the 218 total header in §5.5.
Sourcepub fn total_process_cpu(&self) -> Option<Percent>
pub fn total_process_cpu(&self) -> Option<Percent>
The sum of all per-process CPU percentages, core-normalized.
Used as the denominator of the attribution coverage figure in §2.2. This is deliberately not compared against system CPU as though the two were interchangeable: they are measured differently, and the coverage figure is presented as evidence rather than proof.
Sourcepub fn notable_process_count(&self) -> usize
pub fn notable_process_count(&self) -> usize
How many processes are in a state §7.2 requires to stand out.
Sourcepub fn has_valid_interval(&self) -> bool
pub fn has_valid_interval(&self) -> bool
Whether this snapshot can produce valid rates.
False for the first snapshot, whose elapsed is zero.
Trait Implementations§
Source§impl Clone for SystemSnapshot
impl Clone for SystemSnapshot
Source§fn clone(&self) -> SystemSnapshot
fn clone(&self) -> SystemSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more