pub enum LogRecord {
Outcome {
arm: Arm,
outcome: f64,
session_hash: u64,
cost_usd: f64,
},
Pair {
x_inc: f64,
x_ch: f64,
incumbent_cost_usd: f64,
challenger_cost_usd: f64,
ch_error: bool,
ch_truncated: u64,
ts_unix: i64,
replica_id: Uuid,
trace_id: Uuid,
incumbent_trace_id: Uuid,
},
}Expand description
A record appended to the shared experiment log.
Live mode uses Outcome; paired mode uses Pair. The list for a given
(tenant, route_ix, fingerprint) contains only one kind (the mode is fixed per config).
Variants§
Outcome
One session’s outcome from live mode.
Fields
Pair
One paired shadow result.
Fields
ch_error: boolWhether the challenger call ended in an error with no output.
#[serde(default)] so records written by older replicas deserialize to false.
ch_truncated: u64Number of challenger attempts cut off at the output-token limit.
#[serde(default)] so records written by older replicas deserialize to 0.
ts_unix: i64Unix seconds when this pair was recorded. 0 for records written before this field
was added (treated as “long ago” by ShadowLedger::seed, i.e., not debited today).
replica_id: UuidThe per-process UUID of the replica that wrote this record. Used to skip double-tallying
health and spend on the originating replica (which already tallied them locally when the
challenger call completed). Records from older replicas (missing this field) deserialize
to Uuid::nil(), which never matches any live replica’s UUID and so are treated as remote.
trace_id: UuidThe challenger trace-id, used for cross-source dedup: prevents a pair from being
counted twice when an append times out after Redis applied it (append returns Err but
the record is in the log). #[serde(default)] so records written by older replicas
deserialize to Uuid::nil(), which is never deduplicated.
incumbent_trace_id: UuidThe served incumbent trace-id. A replica restarted on the same trace store has already
counted that request’s incumbent cost from its stored receipt, but it has a new
replica_id, so without this its own pre-restart records would look remote and the
incumbent cost would count twice. Uuid::nil() for older records (never matched).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogRecord
impl<'de> Deserialize<'de> for LogRecord
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>,
impl StructuralPartialEq for LogRecord
Auto Trait Implementations§
impl Freeze for LogRecord
impl RefUnwindSafe for LogRecord
impl Send for LogRecord
impl Sync for LogRecord
impl Unpin for LogRecord
impl UnsafeUnpin for LogRecord
impl UnwindSafe for LogRecord
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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