pub struct UsageStats {
pub prompt_tokens: AtomicU64,
pub requests: AtomicU64,
pub cache_hits: AtomicU64,
pub cache_misses: AtomicU64,
pub failures: AtomicU64,
}Expand description
Token usage statistics.
Fields§
§prompt_tokens: AtomicU64Total prompt tokens used.
requests: AtomicU64Total requests made.
cache_hits: AtomicU64Cache hits.
cache_misses: AtomicU64Cache misses.
failures: AtomicU64Failed requests.
Implementations§
Source§impl UsageStats
impl UsageStats
Sourcepub fn snapshot(&self) -> UsageSnapshot
pub fn snapshot(&self) -> UsageSnapshot
Get a snapshot of current stats.
Trait Implementations§
Source§impl Debug for UsageStats
impl Debug for UsageStats
Source§impl Default for UsageStats
impl Default for UsageStats
Source§fn default() -> UsageStats
fn default() -> UsageStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for UsageStats
impl RefUnwindSafe for UsageStats
impl Send for UsageStats
impl Sync for UsageStats
impl Unpin for UsageStats
impl UnsafeUnpin for UsageStats
impl UnwindSafe for UsageStats
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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request