pub struct ProviderMetrics { /* private fields */ }Expand description
Performance metrics for an embedding provider
Implementations§
Source§impl ProviderMetrics
impl ProviderMetrics
Sourcepub fn record_request(&self)
pub fn record_request(&self)
Record a request attempt
Sourcepub fn record_success(&self, items: u64, tokens: u64, latency_ms: u64)
pub fn record_success(&self, items: u64, tokens: u64, latency_ms: u64)
Record a successful request
Sourcepub fn record_failure(&self)
pub fn record_failure(&self)
Record a failed request
Sourcepub fn record_retry(&self)
pub fn record_retry(&self)
Record a retry attempt
Sourcepub fn record_circuit_breaker_open(&self)
pub fn record_circuit_breaker_open(&self)
Record circuit breaker opening
Sourcepub fn record_circuit_breaker_close(&self)
pub fn record_circuit_breaker_close(&self)
Record circuit breaker closing
Sourcepub fn record_compression(&self, uncompressed: u64, compressed: u64)
pub fn record_compression(&self, uncompressed: u64, compressed: u64)
Record compression metrics
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of current metrics
Trait Implementations§
Source§impl Debug for ProviderMetrics
impl Debug for ProviderMetrics
Source§impl Default for ProviderMetrics
impl Default for ProviderMetrics
Source§fn default() -> ProviderMetrics
fn default() -> ProviderMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ProviderMetrics
impl RefUnwindSafe for ProviderMetrics
impl Send for ProviderMetrics
impl Sync for ProviderMetrics
impl Unpin for ProviderMetrics
impl UnsafeUnpin for ProviderMetrics
impl UnwindSafe for ProviderMetrics
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> 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>
Converts
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>
Converts
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.