#[non_exhaustive]pub struct RunProfile {
pub outcome: Outcome,
pub duration: Duration,
pub cpu_time: Option<Duration>,
pub peak_memory_bytes: Option<u64>,
pub samples: usize,
}stats only.Expand description
Resource summary of one finished run — produced by
RunningProcess::profile.
CPU and memory are sampled from the started child process (the same
source as RunningProcess::cpu_time /
peak_memory_bytes), so they
are None where per-process metrics are unavailable (macOS/BSD) or when
the run exited before the first sample landed.
Non-exhaustive: a read-only summary the crate produces — new metrics can be added without a breaking change.
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.outcome: OutcomeHow the run ended — the full Outcome, so a profile can
distinguish a clean exit from a signal kill from a timeout (all three of
which leave code None). Read it directly, or
via the code / signal /
timed_out convenience accessors. The profile is
therefore a superset of
RunningProcess::wait: one call yields both
the resource telemetry and the run’s actual outcome.
duration: DurationWall-clock time from process start until the run finished (exit reaped and output drained).
cpu_time: Option<Duration>Cumulative CPU time (user + kernel) at the last successful sample.
peak_memory_bytes: Option<u64>Peak resident memory observed across the samples, in bytes.
samples: usizeHow many sampling ticks ran (including ones that found no data).
Implementations§
Source§impl RunProfile
impl RunProfile
Sourcepub fn avg_cpu_cores(&self) -> Option<f64>
pub fn avg_cpu_cores(&self) -> Option<f64>
Average CPU utilisation over the run, in cores (0.5 = half a core
busy on average; can exceed 1.0 for multi-threaded children).
None when CPU time was never observed or the run had no duration.
Sourcepub fn code(&self) -> Option<i32>
pub fn code(&self) -> Option<i32>
The exit code if the run exited, else None
(a signal kill or a timeout). Equals
outcome.code(); the method form completes the
code() / signal() / timed_out()
accessor trio that mirrors ProcessResult and
Outcome.
Trait Implementations§
Source§impl Clone for RunProfile
impl Clone for RunProfile
Source§fn clone(&self) -> RunProfile
fn clone(&self) -> RunProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more