#[non_exhaustive]pub struct ProcessInfo {Show 22 fields
pub id: u32,
pub name: String,
pub status: ProcStatus,
pub pid: Option<u32>,
pub restarts: u32,
pub uptime_ms: u64,
pub fold: Option<String>,
pub depends_on: Vec<String>,
pub out_file: Option<String>,
pub err_file: Option<String>,
pub cpu_percent: Option<f32>,
pub memory_bytes: Option<u64>,
pub dog: Option<DogSource>,
pub lambs: Option<Vec<Lamb>>,
pub last_exit: Option<ExitInfo>,
pub smit: Option<String>,
pub instance: Option<u32>,
pub handshook: Option<bool>,
pub dog_stale: Option<bool>,
pub pending: Option<Vec<String>>,
pub overridden: Option<Vec<String>>,
pub max_memory: Option<u64>,
}Expand description
Snapshot of one sheep for listings and events
Construct one with ProcessInfo::builder: #[non_exhaustive] forbids
a struct literal outside this crate, though not inside it. The fields
stay pub.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: u32Stable numeric id
name: StringSheep name
status: ProcStatusLifecycle status
pid: Option<u32>OS pid while running
restarts: u32Restart count since registration
uptime_ms: u64Milliseconds since last successful start
fold: Option<String>Fold membership
depends_on: Vec<String>Names this sheep waits for at a staged start, from its
depends_on. Empty both when the sheep declares none and when the
peer daemon predates the field.
out_file: Option<String>Resolved stdout log path: the app’s explicit
AppConfig::out_file when it set one, else the daemon-derived
default. None only when the peer daemon predates this field.
err_file: Option<String>Resolved stderr log path, resolved exactly as Self::out_file
cpu_percent: Option<f32>Tree CPU as a percentage of one core, over the window since the
daemon’s last periodic sample. None when the sheep is not running,
when it has been up for less than one sampling window, or when the
peer daemon predates the field; all three render as unknown, never as
zero. A value over 100 is a tree using more than one core.
memory_bytes: Option<u64>Tree resident set size in bytes, current as of the reply. None
under the same three conditions as Self::cpu_percent, minus the
window one: memory needs no baseline.
dog: Option<DogSource>Set when this entry is a dog, naming where the dog came from;
None for a sheep.
Two cases, not Self::cpu_percent’s three: “not a dog” is the true
answer whether the peer predates the field or the entry is a sheep.
lambs: Option<Vec<Lamb>>The processes the OS reports as descendants of this sheep, or None
when this reply did not walk for them.
None covers two cases: this reply is not a Describe (only
Describe walks), or the peer daemon predates the field.
Some(vec![]) is the third: walked, and this sheep has no children.
Read Lamb’s own doc before rendering this: the list is not the set
of processes a stop kills, and any output built from it has to say so.
last_exit: Option<ExitInfo>How this sheep’s process most recently stopped existing under this
daemon. None while it has never exited under this daemon, and when
the peer daemon predates the field.
Sticky across a respawn: it answers why the sheep last stopped, not whether it is stopped now, and updates only on the next exit.
smit: Option<String>The marker a dog has asked to have painted beside this sheep, or
None when no dog has painted one, which also covers a peer daemon
that predates the field.
A String rather than a Smit: this is a report, and the
validation that makes it safe to print happened at the daemon’s
ingress. Every instance of a name shows the same marker, since smits
are keyed by sheep name.
instance: Option<u32>Which instance slot of its app this sheep occupies, counting from 0.
None when the peer daemon predates the field. Not a bare u32
defaulted to 0: an app stocked to four instances would report four
rows all claiming slot 0.
handshook: Option<bool>Whether this dog has completed a handshake with the shepherd that is
reporting it, and not been refused since; None for a sheep.
None on Self::dog’s two-case terms: a sheep has no connection
to the shepherd, so “no handshake fact to report” is the true answer
for a sheep and for a peer that predates the field alike.
Some(false) is the one that matters: a dog on a protocol this
shepherd refuses is alive, which is all Self::status reports, and
not doing its job. A fact and not a verdict, though: a dog spawned a
moment ago has not handshaken yet and is healthy.
dog_stale: Option<bool>Whether the reporting shepherd has given up on this dog: restarted it
once for never answering, watched that not help, and stopped
restarting it. None for a sheep, on Self::handshook’s terms.
Not derivable from Self::handshook. Some(false) there covers
both a dog spawned three seconds ago that has not dialled back and one
this shepherd has permanently stopped restarting; the first needs
nothing done and the second is an incident.
A fact and not a verdict: it says the shepherd stopped, never why.
The why is in that dog’s own log (shep bleats <dog>).
pending: Option<Vec<String>>The AppConfig field names this sheep’s spec differs from a load’s
parked config for, in field-name order. None when nothing is parked,
and when the peer daemon predates the field.
Names only, never values, as SheepDrift::fields carries them: a
differing env reports "env" and stops there. shep reload
promotes a parked config.
overridden: Option<Vec<String>>The AppConfig field names an operator has set on this sheep that
its current Flockfile does not declare, in field-name order. None
when there is nothing to report, and when the peer daemon predates
the field.
Names only, never values, for Self::pending’s reason:
crate::overrides::AppOverrides::fields can hold an env value.
max_memory: Option<u64>The sheep’s max_memory ceiling in bytes, when it has one.
Additive, like Self::instance and Self::handshook before it, so
neither PROTOCOL_VERSION nor SCHEMA_VERSION moves: an older payload
decodes with it absent and an older client ignores it. Lookout’s
MEM/CEIL gauge is the only reader; None draws an all-tail bar
rather than guessing a denominator.
Implementations§
Source§impl ProcessInfo
impl ProcessInfo
Sourcepub fn builder(
id: u32,
name: impl Into<String>,
status: ProcStatus,
) -> ProcessInfoBuilder
pub fn builder( id: u32, name: impl Into<String>, status: ProcStatus, ) -> ProcessInfoBuilder
Starts a builder for one sheep’s row.
The three arguments are the fields no row can omit and no reader can default.
No #[must_use]: ProcessInfoBuilder carries one, which clippy’s
double_must_use lint treats as covering this return too.
Trait Implementations§
Source§impl Clone for ProcessInfo
impl Clone for ProcessInfo
Source§fn clone(&self) -> ProcessInfo
fn clone(&self) -> ProcessInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more