pub struct CacheUsage {
pub reporting_requests: u64,
pub unreported_requests: u64,
pub prompt_tokens: u64,
pub cached_tokens: u64,
pub last_prompt_tokens: Option<u32>,
pub last_cached_tokens: Option<u32>,
}Expand description
A point-in-time view of prompt-cache reuse since the proxy started.
Fields§
§reporting_requests: u64Completed requests whose upstream reported a cached-token count.
The denominator for Self::cached_tokens and Self::prompt_tokens.
unreported_requests: u64Completed requests whose upstream omitted the field. Excluded from every other figure here — counted so a consumer can tell “no reuse” apart from “no data”.
prompt_tokens: u64Total prompt tokens across Self::reporting_requests.
cached_tokens: u64Total prompt tokens served from the KV cache across those requests.
Always <= prompt_tokens.
last_prompt_tokens: Option<u32>Prompt tokens in the most recent reporting request.
last_cached_tokens: Option<u32>Tokens reused from cache in the most recent reporting request.
Trait Implementations§
Source§impl Clone for CacheUsage
impl Clone for CacheUsage
Source§fn clone(&self) -> CacheUsage
fn clone(&self) -> CacheUsage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheUsage
impl Debug for CacheUsage
Source§impl Default for CacheUsage
impl Default for CacheUsage
Source§fn default() -> CacheUsage
fn default() -> CacheUsage
Returns the “default value” for a type. Read more
Source§impl PartialEq for CacheUsage
impl PartialEq for CacheUsage
Source§fn eq(&self, other: &CacheUsage) -> bool
fn eq(&self, other: &CacheUsage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CacheUsage
impl Serialize for CacheUsage
impl Copy for CacheUsage
impl Eq for CacheUsage
impl StructuralPartialEq for CacheUsage
Auto Trait Implementations§
impl Freeze for CacheUsage
impl RefUnwindSafe for CacheUsage
impl Send for CacheUsage
impl Sync for CacheUsage
impl Unpin for CacheUsage
impl UnsafeUnpin for CacheUsage
impl UnwindSafe for CacheUsage
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