pub struct AttemptRecord {Show 13 fields
pub id: Uuid,
pub timestamp: DateTime<Utc>,
pub cmd: String,
pub cwd: String,
pub session_id: String,
pub tag: Option<String>,
pub source_client: String,
pub machine_id: Option<String>,
pub hostname: Option<String>,
pub executable: Option<String>,
pub format_hint: Option<String>,
pub metadata: HashMap<String, Value>,
pub date: NaiveDate,
}Expand description
An attempt record (the start of a command execution).
This represents the “attempt” to run a command - recorded at invocation start.
The outcome (completion) is recorded separately in OutcomeRecord.
Fields§
§id: UuidUnique identifier (UUIDv7 for time-ordering).
timestamp: DateTime<Utc>When the attempt started.
cmd: StringThe full command string.
cwd: StringWorking directory when invocation was executed.
session_id: StringSession identifier (groups related invocations).
tag: Option<String>User-defined tag (unique alias for this invocation, like git tags).
source_client: StringClient identifier (user@hostname or application name).
machine_id: Option<String>Machine identifier (for multi-machine setups).
hostname: Option<String>Hostname where invocation was executed.
executable: Option<String>Extracted executable name (e.g., “make” from “make test”).
format_hint: Option<String>Detected output format (e.g., “gcc”, “pytest”).
metadata: HashMap<String, Value>Extensible metadata (user-defined key-value pairs). Stored as MAP(VARCHAR, JSON) in DuckDB.
date: NaiveDateDate for partitioning.
Implementations§
Source§impl AttemptRecord
impl AttemptRecord
Sourcepub fn new(
session_id: impl Into<String>,
cmd: impl Into<String>,
cwd: impl Into<String>,
source_client: impl Into<String>,
) -> Self
pub fn new( session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, source_client: impl Into<String>, ) -> Self
Create a new attempt record.
If BIRD_INVOCATION_UUID is set in the environment, uses that UUID
to enable deduplication across nested BIRD clients.
Sourcepub fn with_id(
id: Uuid,
session_id: impl Into<String>,
cmd: impl Into<String>,
cwd: impl Into<String>,
source_client: impl Into<String>,
) -> Self
pub fn with_id( id: Uuid, session_id: impl Into<String>, cmd: impl Into<String>, cwd: impl Into<String>, source_client: impl Into<String>, ) -> Self
Create an attempt record with an explicit UUID.
Sourcepub fn with_tag(self, tag: impl Into<String>) -> Self
pub fn with_tag(self, tag: impl Into<String>) -> Self
Set the tag (unique alias for this invocation).
Sourcepub fn with_machine_id(self, machine_id: impl Into<String>) -> Self
pub fn with_machine_id(self, machine_id: impl Into<String>) -> Self
Set the machine ID.
Sourcepub fn with_format_hint(self, hint: impl Into<String>) -> Self
pub fn with_format_hint(self, hint: impl Into<String>) -> Self
Set the format hint.
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 AttemptRecord
impl Clone for AttemptRecord
Source§fn clone(&self) -> AttemptRecord
fn clone(&self) -> AttemptRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more