pub struct UsageEvent {Show 21 fields
pub session_id: String,
pub command: String,
pub path: Option<String>,
pub query: Option<String>,
pub estimated_tokens_without_projectatlas: Option<usize>,
pub estimated_tokens_with_projectatlas: Option<usize>,
pub estimated_tokens_saved: Option<isize>,
pub token_savings_bucket: String,
pub provider: String,
pub model: String,
pub tokenizer_backend: String,
pub accuracy: String,
pub baseline_kind: String,
pub confidence: String,
pub calculation_trace: String,
pub accounting_layer: String,
pub estimate_method: String,
pub denominator_kind: String,
pub baseline_identity: String,
pub baseline_fingerprint: String,
pub dedupe_scope: String,
}Expand description
Token savings event for a funnel command.
Fields§
§session_id: StringOptional caller-visible compatibility label, distinct from runtime identity.
command: StringCommand or tool name.
path: Option<String>Optional path affected by the command.
query: Option<String>Optional query text.
estimated_tokens_without_projectatlas: Option<usize>Baseline token estimate without ProjectAtlas.
estimated_tokens_with_projectatlas: Option<usize>Actual token estimate with ProjectAtlas.
estimated_tokens_saved: Option<isize>Estimated token delta.
token_savings_bucket: StringSavings bucket used for reporting hard evidence separately from modeled savings.
provider: StringProvider used for token counting.
model: StringModel used for token counting.
tokenizer_backend: StringTokenizer or API backend used for token counting.
accuracy: StringAccuracy level for the token count.
baseline_kind: StringBaseline scenario used for the without-ProjectAtlas estimate.
confidence: StringConfidence level for the baseline scenario.
calculation_trace: StringCompact calculation trace.
accounting_layer: StringAccounting layer used to separate measured deltas from modeled avoidance.
estimate_method: StringToken estimate method used for this event.
denominator_kind: StringDenominator represented by the baseline estimate.
baseline_identity: StringStable modeled-baseline identity for deduplication.
baseline_fingerprint: StringStable modeled-baseline fingerprint for deduplication.
dedupe_scope: StringScope used when deduplicating modeled avoidance.
Implementations§
Source§impl UsageEvent
impl UsageEvent
Sourcepub fn is_observed(&self) -> bool
pub fn is_observed(&self) -> bool
Return whether this event represents an observed before/after source comparison.
Sourcepub fn is_modeled(&self) -> bool
pub fn is_modeled(&self) -> bool
Return whether this event represents modeled navigation avoidance.
Sourcepub fn is_observed_file_read_replacement(&self, baseline_tokens: usize) -> bool
pub fn is_observed_file_read_replacement(&self, baseline_tokens: usize) -> bool
Return whether this observed event is strong whole-file replacement evidence.
Sourcepub fn is_modeled_file_read_avoidance(&self, baseline_tokens: usize) -> bool
pub fn is_modeled_file_read_avoidance(&self, baseline_tokens: usize) -> bool
Return whether this modeled event is strong whole-file avoidance evidence.
Sourcepub fn report_accounting_layer(&self) -> &str
pub fn report_accounting_layer(&self) -> &str
Return the normalized accounting layer used by bucket reports.
Sourcepub fn report_denominator_kind(&self) -> &str
pub fn report_denominator_kind(&self) -> &str
Return the normalized denominator used by bucket reports.
Sourcepub fn report_dedupe_scope(&self) -> &str
pub fn report_dedupe_scope(&self) -> &str
Return the normalized deduplication scope used by bucket reports.
Sourcepub fn effective_baseline_identity(&self) -> Cow<'_, str>
pub fn effective_baseline_identity(&self) -> Cow<'_, str>
Return the modeled baseline identity, including the legacy fallback.
Sourcepub fn effective_baseline_fingerprint(&self) -> Cow<'_, str>
pub fn effective_baseline_fingerprint(&self) -> Cow<'_, str>
Return the modeled baseline fingerprint, including the legacy fallback.
Sourcepub fn modeled_baseline_key(&self) -> [u8; 32]
pub fn modeled_baseline_key(&self) -> [u8; 32]
Return the fixed collision-resistant key for one modeled baseline witness.
Trait Implementations§
Source§impl Clone for UsageEvent
impl Clone for UsageEvent
Source§fn clone(&self) -> UsageEvent
fn clone(&self) -> UsageEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UsageEvent
impl Debug for UsageEvent
Source§impl<'de> Deserialize<'de> for UsageEvent
impl<'de> Deserialize<'de> for UsageEvent
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>,
Source§impl PartialEq for UsageEvent
impl PartialEq for UsageEvent
Source§impl Serialize for UsageEvent
impl Serialize for UsageEvent
impl Eq for UsageEvent
impl StructuralPartialEq for UsageEvent
Auto Trait Implementations§
impl Freeze for UsageEvent
impl RefUnwindSafe for UsageEvent
impl Send for UsageEvent
impl Sync for UsageEvent
impl Unpin for UsageEvent
impl UnwindSafe for UsageEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.