#[non_exhaustive]pub struct AgentCommandResources {
pub module_id: String,
pub cpu_ms: u64,
pub memory_bytes: u64,
pub process_count: u64,
pub bound: Option<ResourceBound>,
pub unmeasured_finished: Option<u64>,
pub groups: Vec<ProcessGroup>,
pub cpu_last_hour: Option<CpuLastHour>,
}Expand description
Commands attributed to agents rather than to the module that launches them.
Construct with AgentCommandResources::new and its builders, not a struct literal.
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.module_id: String§cpu_ms: u64§memory_bytes: u64§process_count: u64§bound: Option<ResourceBound>§unmeasured_finished: Option<u64>Accepted commands that finished before any successful CPU measurement. Their CPU remains in the module row, not a fabricated agents zero.
groups: Vec<ProcessGroup>Absent means no live program groups, never unreadable members.
cpu_last_hour: Option<CpuLastHour>Implementations§
Source§impl AgentCommandResources
impl AgentCommandResources
Sourcepub fn new(
module_id: impl Into<String>,
cpu_ms: u64,
memory_bytes: u64,
process_count: u64,
) -> Self
pub fn new( module_id: impl Into<String>, cpu_ms: u64, memory_bytes: u64, process_count: u64, ) -> Self
Create measured command totals without optional attribution metadata.
Sourcepub fn with_bound(self, bound: Option<ResourceBound>) -> Self
pub fn with_bound(self, bound: Option<ResourceBound>) -> Self
Set or clear the cumulative CPU lower-bound marker.
Sourcepub fn with_unmeasured_finished(self, unmeasured_finished: Option<u64>) -> Self
pub fn with_unmeasured_finished(self, unmeasured_finished: Option<u64>) -> Self
Set or clear the count of finished commands whose CPU was unmeasured.
Sourcepub fn with_groups(self, groups: Vec<ProcessGroup>) -> Self
pub fn with_groups(self, groups: Vec<ProcessGroup>) -> Self
Replace live command program groups; an empty list clears them.
Sourcepub fn with_cpu_last_hour(self, cpu_last_hour: Option<CpuLastHour>) -> Self
pub fn with_cpu_last_hour(self, cpu_last_hour: Option<CpuLastHour>) -> Self
Set or clear retained hourly CPU attributed to commands.
Trait Implementations§
Source§impl Clone for AgentCommandResources
impl Clone for AgentCommandResources
Source§impl Debug for AgentCommandResources
impl Debug for AgentCommandResources
Source§impl<'de> Deserialize<'de> for AgentCommandResources
impl<'de> Deserialize<'de> for AgentCommandResources
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AgentCommandResources
Source§impl PartialEq for AgentCommandResources
impl PartialEq for AgentCommandResources
Source§impl Serialize for AgentCommandResources
impl Serialize for AgentCommandResources
impl StructuralPartialEq for AgentCommandResources
Auto Trait Implementations§
impl Forget for AgentCommandResources
impl Freeze for AgentCommandResources
impl RefUnwindSafe for AgentCommandResources
impl Send for AgentCommandResources
impl Sync for AgentCommandResources
impl Unpin for AgentCommandResources
impl UnsafeUnpin for AgentCommandResources
impl UnwindSafe for AgentCommandResources
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more