Skip to main content

ClientMetricsSnapshot

Struct ClientMetricsSnapshot 

Source
pub struct ClientMetricsSnapshot {
Show 18 fields pub requests_started: u64, pub requests_succeeded: u64, pub requests_failed: u64, pub requests_timed_out: u64, pub requests_cancelled: u64, pub broker_errors: u64, pub retries: u64, pub buffered_records: u64, pub max_buffered_records: u64, pub produced_records: u64, pub produce_batches: u64, pub consumed_records: u64, pub request_bytes: u64, pub response_bytes: u64, pub in_flight_requests: u64, pub total_latency: Duration, pub max_latency: Duration, pub request_latency_buckets: [u64; 13],
}
Expand description

Point-in-time values from ClientMetrics.

Fields§

§requests_started: u64

Request roundtrips that have started.

§requests_succeeded: u64

Request roundtrips that completed successfully.

§requests_failed: u64

Request roundtrips that returned an error, including timeouts.

§requests_timed_out: u64

Failed request roundtrips caused by the configured request timeout.

§requests_cancelled: u64

Request futures dropped before producing a result.

§broker_errors: u64

Non-zero Kafka error codes observed in decoded broker responses.

§retries: u64

Additional high-level operation attempts after an initial attempt.

§buffered_records: u64

Buffered producer records accepted and not yet completed.

§max_buffered_records: u64

Highest observed number of outstanding buffered producer records.

§produced_records: u64

Records successfully acknowledged by Produce operations.

§produce_batches: u64

Successful topic-partition Produce chunks.

§consumed_records: u64

Records returned to callers by consumer poll and fetch operations.

§request_bytes: u64

Kafka request payload bytes, excluding the four-byte frame length.

§response_bytes: u64

Kafka response payload bytes, excluding the four-byte frame length.

§in_flight_requests: u64

Request roundtrips currently awaiting completion.

§total_latency: Duration

Sum of completed and cancelled request latency.

§max_latency: Duration

Highest observed completed or cancelled request latency.

§request_latency_buckets: [u64; 13]

Approximate request latency histogram, using the documented upper-bound buckets from Self::latency_percentile.

Implementations§

Source§

impl ClientMetricsSnapshot

Source

pub fn latency_percentile(&self, percentile: u8) -> Option<Duration>

Returns an upper-bound latency estimate for a percentile in the range 0..=100.

The result is approximate because the client records counts in fixed upper-bound buckets instead of retaining every request duration. It returns None when no request has completed or when percentile is greater than 100.

Trait Implementations§

Source§

impl Clone for ClientMetricsSnapshot

Source§

fn clone(&self) -> ClientMetricsSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ClientMetricsSnapshot

Source§

impl Debug for ClientMetricsSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientMetricsSnapshot

Source§

fn default() -> ClientMetricsSnapshot

Returns the “default value” for a type. Read more
Source§

impl Eq for ClientMetricsSnapshot

Source§

impl PartialEq for ClientMetricsSnapshot

Source§

fn eq(&self, other: &ClientMetricsSnapshot) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ClientMetricsSnapshot

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more