Skip to main content

MetricsCallBuffer

Struct MetricsCallBuffer 

Source
pub struct MetricsCallBuffer<I>{ /* private fields */ }
Expand description

Buffers MetricEvents for periodic consumption by lang

Implementations§

Source§

impl<I> MetricsCallBuffer<I>

Source

pub fn new(buffer_size: usize) -> Self

Create a new buffer with the given capacity

Trait Implementations§

Source§

impl<I> CoreMeter for MetricsCallBuffer<I>
where I: BufferInstrumentRef + Debug + Send + Sync + Clone + 'static,

Source§

fn new_attributes(&self, opts: NewAttributes) -> MetricAttributes

Given some k/v pairs, create a return a new instantiated instance of metric attributes. Only MetricAttributes created by this meter can be used when calling record on instruments created by this meter.
Source§

fn extend_attributes( &self, existing: MetricAttributes, attribs: NewAttributes, ) -> MetricAttributes

Extend some existing attributes with new values. Implementations should create new instances when doing so, rather than mutating whatever is backing the passed in existing attributes. Ideally that new instance retains a ref to the extended old attribute, promoting re-use.
Source§

fn counter(&self, params: MetricParameters) -> Counter

Create a new counter instrument.
Source§

fn histogram(&self, params: MetricParameters) -> Histogram

Create a new histogram instrument recording u64 values.
Source§

fn histogram_f64(&self, params: MetricParameters) -> HistogramF64

Create a new histogram instrument recording f64 values.
Source§

fn histogram_duration(&self, params: MetricParameters) -> HistogramDuration

Create a histogram which records Durations. Implementations should choose to emit in either milliseconds or seconds depending on how they have been configured. MetricParameters::unit should be overwritten by implementations to be ms or s accordingly.
Source§

fn gauge(&self, params: MetricParameters) -> Gauge

Create a new gauge instrument recording u64 values.
Source§

fn gauge_f64(&self, params: MetricParameters) -> GaugeF64

Create a new gauge instrument recording f64 values.
Source§

fn up_down_counter(&self, params: MetricParameters) -> UpDownCounter

Create a new up-down counter instrument recording i64 values.
Source§

fn counter_with_in_memory( &self, params: MetricParameters, in_memory_counter: HeartbeatMetricType, ) -> Counter

Create a counter with in-memory tracking for worker heartbeating reporting
Source§

fn histogram_duration_with_in_memory( &self, params: MetricParameters, in_memory_hist: HeartbeatMetricType, ) -> HistogramDuration

Create a histogram duration with in-memory tracking for worker heartbeating reporting
Source§

fn gauge_with_in_memory( &self, params: MetricParameters, in_memory_metrics: HeartbeatMetricType, ) -> Gauge

Create a gauge with in-memory tracking for worker heartbeating reporting
Source§

impl<I> Debug for MetricsCallBuffer<I>

Source§

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

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

impl<I> MetricCallBufferer<I> for MetricsCallBuffer<I>

Source§

fn retrieve(&self) -> Vec<MetricEvent<I>>

Drain and return all buffered metric events.

Auto Trait Implementations§

§

impl<I> Freeze for MetricsCallBuffer<I>

§

impl<I> RefUnwindSafe for MetricsCallBuffer<I>

§

impl<I> Send for MetricsCallBuffer<I>
where I: Sync + Send,

§

impl<I> Sync for MetricsCallBuffer<I>
where I: Sync + Send,

§

impl<I> Unpin for MetricsCallBuffer<I>

§

impl<I> UnsafeUnpin for MetricsCallBuffer<I>

§

impl<I> UnwindSafe for MetricsCallBuffer<I>

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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

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<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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
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
Source§

impl<T> ErasedDestructor for T
where T: 'static,