#[non_exhaustive]pub struct RunProfile {
pub outcome: Outcome,
pub exit_code: Option<i32>,
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 exit_code None). Read it directly, or
via the 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.
exit_code: Option<i32>The exit code if the run exited; None for a run
killed by its timeout or a signal. Equals
outcome.code() — a convenience for the common
case; consult outcome to tell a timeout from a signal.
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 avg_cpu(&self) -> Option<f64>
👎Deprecated since 1.1.0: renamed to avg_cpu_cores (the unit is cores); removed in 2.0
pub fn avg_cpu(&self) -> Option<f64>
renamed to avg_cpu_cores (the unit is cores); removed in 2.0
Renamed to avg_cpu_cores: the value is in CPU
cores, and the suffix makes the unit self-documenting. A thin
forwarding shim kept for one minor; removed in 2.0.
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 the exit_code
field and 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 moreimpl Copy for RunProfile
Source§impl Debug for RunProfile
impl Debug for RunProfile
impl Eq for RunProfile
Source§impl PartialEq for RunProfile
impl PartialEq for RunProfile
Source§fn eq(&self, other: &RunProfile) -> bool
fn eq(&self, other: &RunProfile) -> bool
self and other values to be equal, and is used by ==.