[−][src]Struct metrix::instruments::GaugeAdapter
Methods
impl<L> GaugeAdapter<L> where
L: Eq + Send + 'static,
[src]
L: Eq + Send + 'static,
pub fn new(gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches all observations
to the Gauge
pub fn accept<F: Into<LabelFilter<L>>>(accept: F, gauge: Gauge) -> Self
[src]
pub fn for_label(label: L, gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches observations
with the given label to the Gauge
pub fn for_labels(labels: Vec<L>, gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches observations
with the given labels to the Gauge
If labels
is empty, no observations will be dispatched
pub fn for_labels_by_predicate<P>(label_predicate: P, gauge: Gauge) -> Self where
P: Fn(&L) -> bool + Send + 'static,
[src]
P: Fn(&L) -> bool + Send + 'static,
Creates a GaugeAdapter
that makes this instrument react on
observations with labels specified by the predicate.
pub fn deltas_only<F: Into<LabelFilter<L>>>(accept: F, gauge: Gauge) -> Self
[src]
pub fn for_label_deltas_only(label: L, gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches observations
with the given label to the Gauge
The Gauge will only be dispatched message that increment or decrement the value
pub fn for_labels_deltas_only(labels: Vec<L>, gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches observations
with the given labels to the Gauge
If labels
is empty, no observations will be dispatched
The Gauge will only be dispatched message that increment or decrement the value
pub fn for_labels_deltas_only_by_predicate<P>(
label_predicate: P,
gauge: Gauge
) -> Self where
P: Fn(&L) -> bool + Send + 'static,
[src]
label_predicate: P,
gauge: Gauge
) -> Self where
P: Fn(&L) -> bool + Send + 'static,
Creates a GaugeAdapter
that makes this instrument react on
observations with labels specified by the predicate.
pub fn inc_dec_on<INCR: Into<LabelFilter<L>>, DECR: Into<LabelFilter<L>>>(
accept_incr: INCR,
accept_decr: DECR,
gauge: Gauge
) -> Self
[src]
accept_incr: INCR,
accept_decr: DECR,
gauge: Gauge
) -> Self
Creates a new adapter which dispatches observations
with the given labels to the Gauge
which only increment or
decrement the Gauge
The Gauge
will increment on any observation with label increment_on
and decrement for any observation with label decrement_on
.
increment_on
is evaluated first so
increment_on
and decrement_on
should not be the same label.
pub fn inc_dec_on_many(
increment_on: Vec<L>,
decrement_on: Vec<L>,
gauge: Gauge
) -> Self
[src]
increment_on: Vec<L>,
decrement_on: Vec<L>,
gauge: Gauge
) -> Self
Creates a new adapter which dispatches observations
with the given labels to the Gauge
which only increment or
decrement the Gauge
The Gauge
will increment on any observation with a label in increment_on
and decrement for any observation with a label in decrement_on
.
increment_on
is evaluated first so
increment_on
and decrement_on
should share labels.
pub fn inc_dec_by_predicates<PINC, PDEC>(
predicate_inc: PINC,
predicate_dec: PDEC,
gauge: Gauge
) -> Self where
PINC: Fn(&L) -> bool + Send + 'static,
PDEC: Fn(&L) -> bool + Send + 'static,
[src]
predicate_inc: PINC,
predicate_dec: PDEC,
gauge: Gauge
) -> Self where
PINC: Fn(&L) -> bool + Send + 'static,
PDEC: Fn(&L) -> bool + Send + 'static,
Creates a GaugeAdapter
that makes this instrument react on
observations with labels specified by the predicate.
pub fn deaf(gauge: Gauge) -> Self
[src]
Creates a new adapter which dispatches no
observations to the Gauge
pub fn gauge(&self) -> &Gauge
[src]
pub fn gauge_mut(&mut self) -> &mut Gauge
[src]
pub fn into_inner(self) -> Gauge
[src]
Trait Implementations
impl<L> From<Gauge> for GaugeAdapter<L> where
L: Clone + Eq + Send + 'static,
[src]
L: Clone + Eq + Send + 'static,
fn from(gauge: Gauge) -> GaugeAdapter<L>
[src]
impl<L> HandlesObservations for GaugeAdapter<L> where
L: Eq + Send + 'static,
[src]
L: Eq + Send + 'static,
type Label = L
fn handle_observation(
&mut self,
observation: &Observation<Self::Label>
) -> usize
[src]
&mut self,
observation: &Observation<Self::Label>
) -> usize
impl<L> PutsSnapshot for GaugeAdapter<L> where
L: Send + 'static,
[src]
L: Send + 'static,
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
Auto Trait Implementations
impl<L> !RefUnwindSafe for GaugeAdapter<L>
impl<L> Send for GaugeAdapter<L> where
L: Send,
L: Send,
impl<L> !Sync for GaugeAdapter<L>
impl<L> Unpin for GaugeAdapter<L> where
L: Unpin,
L: Unpin,
impl<L> !UnwindSafe for GaugeAdapter<L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,