[][src]Struct metrix::instruments::polled::PollingInstrument

pub struct PollingInstrument<P> {
    pub name: String,
    pub title: Option<String>,
    pub description: Option<String>,
    pub poll: P,
    pub create_group_with_name: bool,
}

Create an instrument that delivers metrics based on querying values when a Snapshot is requested.

The Snapshot can be generated from anything that implements PutsSnapshot.

Fields

name: String

If create_group_with_name is true, this name will create a new named group.

title: Option<String>description: Option<String>poll: Pcreate_group_with_name: bool

Methods

impl<P> PollingInstrument<P> where
    P: PutsSnapshot
[src]

pub fn new_with_defaults<T: Into<String>>(
    name: T,
    poll: P
) -> PollingInstrument<P>
[src]

pub fn get_name(&self) -> &str[src]

Gets the name of this PollingInstrument

pub fn set_name<T: Into<String>>(&mut self, name: T)[src]

Set the name if this PollingInstrument.

The name is a path segment within a Snapshot if self.create_group_with_name is set to true.

pub fn create_group_with_name(&self) -> bool[src]

Returns whether a new group with the instruments name shall be craeted in the snapshot.

pub fn set_create_group_with_name(&mut self, create_group: bool)[src]

Set to true if you want to create a new group with the name of this instrument when a Snapshot is requested.

pub fn set_title<T: Into<String>>(&mut self, title: T)[src]

Sets the title of this PollingInstrument.

A title can be part of a descriptive Snapshot

pub fn set_description<T: Into<String>>(&mut self, description: T)[src]

Sets the description of this PollingInstrument.

A description can be part of a descriptive Snapshot

Trait Implementations

impl<P> Descriptive for PollingInstrument<P>[src]

impl<P> PutsSnapshot for PollingInstrument<P> where
    P: PutsSnapshot
[src]

Auto Trait Implementations

impl<P> RefUnwindSafe for PollingInstrument<P> where
    P: RefUnwindSafe

impl<P> Send for PollingInstrument<P> where
    P: Send

impl<P> Sync for PollingInstrument<P> where
    P: Sync

impl<P> Unpin for PollingInstrument<P> where
    P: Unpin

impl<P> UnwindSafe for PollingInstrument<P> where
    P: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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