pub struct MetricsStream {
pub throughput: TimeSeries,
pub latency: StreamingHistogram,
pub error_rate: TimeSeries,
pub active_users: TimeSeries,
}Expand description
Metrics stream for real-time dashboard
Fields§
§throughput: TimeSeriesThroughput time series (req/s)
latency: StreamingHistogramLatency histogram
error_rate: TimeSeriesError rate time series (%)
active_users: TimeSeriesActive users time series
Implementations§
Source§impl MetricsStream
impl MetricsStream
Sourcepub fn record_request(
&mut self,
timestamp_ms: u64,
latency_ms: u64,
success: bool,
)
pub fn record_request( &mut self, timestamp_ms: u64, latency_ms: u64, success: bool, )
Record a request
Sourcepub fn update_throughput(&mut self, timestamp_ms: u64, requests_per_sec: f64)
pub fn update_throughput(&mut self, timestamp_ms: u64, requests_per_sec: f64)
Update throughput
Sourcepub fn update_error_rate(&mut self, timestamp_ms: u64, error_percent: f64)
pub fn update_error_rate(&mut self, timestamp_ms: u64, error_percent: f64)
Update error rate
Sourcepub fn update_active_users(&mut self, timestamp_ms: u64, users: u32)
pub fn update_active_users(&mut self, timestamp_ms: u64, users: u32)
Update active users
Trait Implementations§
Source§impl Clone for MetricsStream
impl Clone for MetricsStream
Source§fn clone(&self) -> MetricsStream
fn clone(&self) -> MetricsStream
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 MetricsStream
impl Debug for MetricsStream
Source§impl Default for MetricsStream
impl Default for MetricsStream
Source§impl<'de> Deserialize<'de> for MetricsStream
impl<'de> Deserialize<'de> for MetricsStream
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MetricsStream
impl RefUnwindSafe for MetricsStream
impl Send for MetricsStream
impl Sync for MetricsStream
impl Unpin for MetricsStream
impl UnsafeUnpin for MetricsStream
impl UnwindSafe for MetricsStream
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().