Skip to main content

ProcessInfo

Struct ProcessInfo 

Source
#[non_exhaustive]
pub struct ProcessInfo {
Show 21 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 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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: u32

Stable numeric id

§name: String

Sheep name

§status: ProcStatus

Lifecycle status

§pid: Option<u32>

OS pid while running

§restarts: u32

Restart count since registration

§uptime_ms: u64

Milliseconds since last successful start

§fold: Option<String>

Fold membership

§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

Source

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

Source§

fn clone(&self) -> ProcessInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProcessInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ProcessInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ProcessInfo

Source§

fn eq(&self, other: &ProcessInfo) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ProcessInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ProcessInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.