#[non_exhaustive]pub struct CgroupProcsSnapshot {
pub tag: String,
pub cgroup: String,
pub pids: Vec<pid_t>,
}Expand description
A single cgroup.procs snapshot captured by
Op::CaptureCgroupProcs.
Tests drain the per-bridge log of these via
SnapshotBridge::drain_cgroup_procs after the scenario completes,
then assert on the captured pids (membership, count, identity)
against the workload they spawned. Carries:
tag: the snapshot key supplied in the Op (lets a scenario capture pre/post snapshots of the same cgroup at different points and disambiguate them on drain).cgroup: the cgroup name the kernel read returned PIDs for.pids: the thread-group leaders (PIDs / TGIDs) the kernel reported incgroup.procsat capture time. An empty Vec means the cgroup existed but held no tasks. A read against a missing cgroup directory errors at the dispatch arm and never produces a snapshot — so the presence of aCgroupProcsSnapshotin the drain log implies the read succeeded.
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.tag: StringSnapshot key supplied to
Op::CaptureCgroupProcs.
Distinguishes multiple captures of the same cgroup.
cgroup: StringCgroup name the kernel read returned PIDs for.
pids: Vec<pid_t>Thread-group leaders in the cgroup at capture time.
libc::pid_t is i32 on Linux; compare against other ktstr
pid surfaces (WorkloadHandle::worker_pids(), etc.) via the
matching integer type or as i32 cast when types differ.
Implementations§
Source§impl CgroupProcsSnapshot
impl CgroupProcsSnapshot
Sourcepub fn new(
tag: impl Into<String>,
cgroup: impl Into<String>,
pids: Vec<pid_t>,
) -> Self
pub fn new( tag: impl Into<String>, cgroup: impl Into<String>, pids: Vec<pid_t>, ) -> Self
Construct a CgroupProcsSnapshot. The struct is
#[non_exhaustive] so external callers cannot use
struct-literal syntax — use this constructor instead. The
framework’s SnapshotBridge::record_cgroup_procs dispatch
site routes through here so test fixtures that synthesise
snapshots for drain-consumer testing share the same
construction path.
Trait Implementations§
Source§impl Clone for CgroupProcsSnapshot
impl Clone for CgroupProcsSnapshot
Source§fn clone(&self) -> CgroupProcsSnapshot
fn clone(&self) -> CgroupProcsSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CgroupProcsSnapshot
impl Debug for CgroupProcsSnapshot
Source§impl<'de> Deserialize<'de> for CgroupProcsSnapshot
impl<'de> Deserialize<'de> for CgroupProcsSnapshot
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>,
Source§impl Hash for CgroupProcsSnapshot
impl Hash for CgroupProcsSnapshot
Source§impl PartialEq for CgroupProcsSnapshot
impl PartialEq for CgroupProcsSnapshot
Source§impl Serialize for CgroupProcsSnapshot
impl Serialize for CgroupProcsSnapshot
impl Eq for CgroupProcsSnapshot
impl StructuralPartialEq for CgroupProcsSnapshot
Auto Trait Implementations§
impl Freeze for CgroupProcsSnapshot
impl RefUnwindSafe for CgroupProcsSnapshot
impl Send for CgroupProcsSnapshot
impl Sync for CgroupProcsSnapshot
impl Unpin for CgroupProcsSnapshot
impl UnwindSafe for CgroupProcsSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more