pub struct StreamMetrics { /* private fields */ }Expand description
Thread-safe aggregate metrics handle.
Construct one, pass an Arc<StreamMetrics> to
Client::stream_arrow_with_observer,
keep a clone, and call summary during or after the stream.
Implementations§
Source§impl StreamMetrics
impl StreamMetrics
Sourcepub fn record_buffered_bytes(&self, bytes: u64)
pub fn record_buffered_bytes(&self, bytes: u64)
Record the current undelivered-buffer size; keeps the observed maximum.
Sourcepub fn record_in_flight(&self, count: u64)
pub fn record_in_flight(&self, count: u64)
Record the current in-flight request count (one sample per scheduler iteration), for the mean-in-flight estimate.
Sourcepub fn record_elapsed(&self, elapsed: Duration)
pub fn record_elapsed(&self, elapsed: Duration)
Feed the engine’s monotonic elapsed time so throughput can be derived.
Sourcepub fn summary(&self) -> StreamSummary
pub fn summary(&self) -> StreamSummary
Snapshot the current aggregate summary. Safe to call at any time.
Trait Implementations§
Source§impl Debug for StreamMetrics
impl Debug for StreamMetrics
Source§impl Default for StreamMetrics
impl Default for StreamMetrics
Source§impl StreamObserver for StreamMetrics
impl StreamObserver for StreamMetrics
Source§fn on_request(&self, stats: &RequestStats)
fn on_request(&self, stats: &RequestStats)
Called once for every completed HTTP request.
Source§fn on_progress(&self, in_flight: u64, buffered_bytes: u64)
fn on_progress(&self, in_flight: u64, buffered_bytes: u64)
Called once per scheduler iteration with the current in-flight request
count and undelivered reorder-buffer size. Lets observers track buffer
high-water and concurrency saturation live. Default: no-op.
Source§fn on_finish(&self, _summary: &StreamSummary)
fn on_finish(&self, _summary: &StreamSummary)
Called once when the stream finishes (or is closed early), with the final
aggregate summary. Default: no-op.
Auto Trait Implementations§
impl !Freeze for StreamMetrics
impl RefUnwindSafe for StreamMetrics
impl Send for StreamMetrics
impl Sync for StreamMetrics
impl Unpin for StreamMetrics
impl UnsafeUnpin for StreamMetrics
impl UnwindSafe for StreamMetrics
Blanket Implementations§
impl<T> Allocation for T
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
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 more