pub struct VariantMetrics {
pub variant_id: String,
pub requests: AtomicU64,
pub total_latency_ms: AtomicU64,
pub total_tokens: AtomicU64,
pub successes: AtomicU64,
}Expand description
Atomic per-variant statistics accumulated during the test.
Fields§
§variant_id: StringThe variant these metrics belong to.
requests: AtomicU64Total requests routed to this variant.
total_latency_ms: AtomicU64Sum of observed latencies in milliseconds.
total_tokens: AtomicU64Sum of tokens consumed.
successes: AtomicU64Number of successful completions.
Implementations§
Source§impl VariantMetrics
impl VariantMetrics
Sourcepub fn avg_latency(&self) -> f64
pub fn avg_latency(&self) -> f64
Average latency in milliseconds, or 0.0 if no requests yet.
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Fraction of requests that succeeded (0.0–1.0).
Sourcepub fn avg_tokens(&self) -> f64
pub fn avg_tokens(&self) -> f64
Average tokens per request.
Auto Trait Implementations§
impl !Freeze for VariantMetrics
impl RefUnwindSafe for VariantMetrics
impl Send for VariantMetrics
impl Sync for VariantMetrics
impl Unpin for VariantMetrics
impl UnsafeUnpin for VariantMetrics
impl UnwindSafe for VariantMetrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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