pub struct PersistedUsage {
pub ts: u64,
pub models: HashMap<String, ModelUsage>,
pub cohorts: HashMap<String, CohortUsage>,
pub last_model: Option<LastModel>,
pub projects: HashMap<String, HashMap<String, ModelUsage>>,
pub sessions: HashMap<String, SessionUsage>,
pub unattributed: SessionUsage,
}Expand description
On-disk shape of the measured spend totals.
Fields§
§ts: u64§models: HashMap<String, ModelUsage>§cohorts: HashMap<String, CohortUsage>Output-savings cohort totals (#895). #[serde(default)] keeps older
proxy_usage.json files (written before the holdout existed) loadable.
last_model: Option<LastModel>The foreground model of the most recent finalized turn and when it was seen (unix seconds), so other processes can attribute work to the model in use now rather than the all-time largest bucket.
projects: HashMap<String, HashMap<String, ModelUsage>>The same totals per project key and model (the folder the agent named
in each request). Turns that named none stay in models only, which
remains the device total.
sessions: HashMap<String, SessionUsage>The same totals per app session (the x-leanctx-session-id header a
launching app sends, see core::activity::SESSION_HEADER); only the
most recently used sessions are kept. Attribution only.
unattributed: SessionUsageThe same totals for turns that carried no (valid) session header — the unattributed bucket of the session ledger. Never evicted.
Trait Implementations§
Source§impl Clone for PersistedUsage
impl Clone for PersistedUsage
Source§fn clone(&self) -> PersistedUsage
fn clone(&self) -> PersistedUsage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PersistedUsage
impl Debug for PersistedUsage
Source§impl Default for PersistedUsage
impl Default for PersistedUsage
Source§fn default() -> PersistedUsage
fn default() -> PersistedUsage
Source§impl<'de> Deserialize<'de> for PersistedUsage
impl<'de> Deserialize<'de> for PersistedUsage
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PersistedUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PersistedUsage, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for PersistedUsage
impl Serialize for PersistedUsage
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Forget for PersistedUsage
impl Freeze for PersistedUsagewhere
*const u8 is !null: Freeze,
PhantomData<(String, ModelUsage)>: Freeze,
PhantomData<(String, CohortUsage)>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, HashMap<String, ModelUsage>)>: Freeze,
PhantomData<(String, SessionUsage)>: Freeze,
impl Move for PersistedUsage
impl RefUnwindSafe for PersistedUsage
impl Send for PersistedUsagewhere
RawTable<(String, ModelUsage)>: Send,
RawTable<(String, CohortUsage)>: Send,
RawVecInner: Send,
RawTable<(String, HashMap<String, ModelUsage>)>: Send,
RawTable<(String, SessionUsage)>: Send,
impl Sync for PersistedUsagewhere
RawTable<(String, ModelUsage)>: Sync,
RawTable<(String, CohortUsage)>: Sync,
RawVecInner: Sync,
RawTable<(String, HashMap<String, ModelUsage>)>: Sync,
RawTable<(String, SessionUsage)>: Sync,
impl Unpin for PersistedUsage
impl UnsafeUnpin for PersistedUsagewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ModelUsage)>: UnsafeUnpin,
PhantomData<(String, CohortUsage)>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, HashMap<String, ModelUsage>)>: UnsafeUnpin,
PhantomData<(String, SessionUsage)>: UnsafeUnpin,
impl UnwindSafe for PersistedUsagewhere
HashMap<String, ModelUsage>: UnwindSafe,
HashMap<String, CohortUsage>: UnwindSafe,
RawVecInner: UnwindSafe,
HashMap<String, HashMap<String, ModelUsage>>: UnwindSafe,
HashMap<String, SessionUsage>: UnwindSafe,
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