pub struct OutcomeRecord {
pub attempt_id: Uuid,
pub completed_at: DateTime<Utc>,
pub exit_code: Option<i32>,
pub duration_ms: Option<i64>,
pub signal: Option<i32>,
pub timeout: bool,
pub metadata: HashMap<String, Value>,
pub date: NaiveDate,
}Expand description
An outcome record (the completion of a command execution).
This represents the “outcome” of a command - recorded at invocation end.
Links back to an AttemptRecord via attempt_id.
Fields§
§attempt_id: UuidThe attempt this outcome is for.
completed_at: DateTime<Utc>When the invocation completed.
exit_code: Option<i32>Exit code (None if killed by signal or crashed).
duration_ms: Option<i64>How long the invocation took in milliseconds.
signal: Option<i32>Signal that terminated the process (if killed by signal).
timeout: boolWhether the process was terminated due to timeout.
metadata: HashMap<String, Value>Extensible metadata (user-defined key-value pairs). Stored as MAP(VARCHAR, JSON) in DuckDB.
date: NaiveDateDate for partitioning (matches the attempt date).
Implementations§
Source§impl OutcomeRecord
impl OutcomeRecord
Sourcepub fn completed(
attempt_id: Uuid,
exit_code: i32,
duration_ms: Option<i64>,
date: NaiveDate,
) -> Self
pub fn completed( attempt_id: Uuid, exit_code: i32, duration_ms: Option<i64>, date: NaiveDate, ) -> Self
Create a new completed outcome record.
Sourcepub fn killed(
attempt_id: Uuid,
signal: i32,
duration_ms: Option<i64>,
date: NaiveDate,
) -> Self
pub fn killed( attempt_id: Uuid, signal: i32, duration_ms: Option<i64>, date: NaiveDate, ) -> Self
Create an outcome for a process killed by signal.
Sourcepub fn timed_out(attempt_id: Uuid, duration_ms: i64, date: NaiveDate) -> Self
pub fn timed_out(attempt_id: Uuid, duration_ms: i64, date: NaiveDate) -> Self
Create an outcome for a timed-out process.
Sourcepub fn orphaned(attempt_id: Uuid, date: NaiveDate) -> Self
pub fn orphaned(attempt_id: Uuid, date: NaiveDate) -> Self
Create an orphaned outcome (process crashed or was killed without cleanup).
Sourcepub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
pub fn with_metadata(self, key: impl Into<String>, value: Value) -> Self
Add metadata entry.
Trait Implementations§
Source§impl Clone for OutcomeRecord
impl Clone for OutcomeRecord
Source§fn clone(&self) -> OutcomeRecord
fn clone(&self) -> OutcomeRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more