[][src]Trait metrix::TransmitsTelemetryData

pub trait TransmitsTelemetryData<L> {
    fn transmit(&self, observation: Observation<L>) -> &Self;
fn add_handler<H: HandlesObservations<Label = L>>(
        &self,
        handler: H
    ) -> &Self
    where
        L: Send + 'static
;
fn add_cockpit(&self, cockpit: Cockpit<L>) -> &Self;
fn remove_cockpit<T: Into<String>>(&self, name: T) -> &Self;
fn add_panel_to_cockpit<T: Into<String>>(
        &self,
        cockpit_name: T,
        panel: Panel<L>
    ) -> &Self;
fn remove_panel_from_cockpit<U: Into<String>, V: Into<String>>(
        &self,
        cockpit_name: U,
        panel_name: V
    ) -> &Self; fn observed(&self, label: L, count: u64, timestamp: Instant) -> &Self { ... }
fn observed_one(&self, label: L, timestamp: Instant) -> &Self { ... }
fn observed_one_value<V: Into<ObservedValue>>(
        &self,
        label: L,
        value: V,
        timestamp: Instant
    ) -> &Self { ... }
fn observed_duration(
        &self,
        label: L,
        duration: Duration,
        timestamp: Instant
    ) -> &Self { ... }
fn observed_now(&self, label: L, count: u64) -> &Self { ... }
fn observed_one_now(&self, label: L) -> &Self { ... }
fn observed_one_value_now<V: Into<ObservedValue>>(
        &self,
        label: L,
        value: V
    ) -> &Self { ... }
fn observed_one_duration_now(&self, label: L, duration: Duration) -> &Self { ... }
fn measure_time(&self, label: L, from: Instant) -> &Self { ... } }

Transmits telemetry data to the backend.

Implementors should transfer Observations to a backend and manipulate the instruments there to not to interfere to much with the actual task being measured/observed

Required methods

fn transmit(&self, observation: Observation<L>) -> &Self

Transit an observation to the backend.

fn add_handler<H: HandlesObservations<Label = L>>(&self, handler: H) -> &Self where
    L: Send + 'static, 

Add a handler.

fn add_cockpit(&self, cockpit: Cockpit<L>) -> &Self

Add a Copckpit

If the cockpit has a name and another cockpit with the same name is already present the cockpit will not be added.

fn remove_cockpit<T: Into<String>>(&self, name: T) -> &Self

fn add_panel_to_cockpit<T: Into<String>>(
    &self,
    cockpit_name: T,
    panel: Panel<L>
) -> &Self

Add a Panel to a Cockpit if that Cockpit has the given name.

fn remove_panel_from_cockpit<U: Into<String>, V: Into<String>>(
    &self,
    cockpit_name: U,
    panel_name: V
) -> &Self

Removes the panel with the given name from a cockpit with the given name.

This means the cockpit and the panel must have a name set.

Loading content...

Provided methods

fn observed(&self, label: L, count: u64, timestamp: Instant) -> &Self

Observed count occurrences at time timestamp

Convenience method. Simply calls transmit

fn observed_one(&self, label: L, timestamp: Instant) -> &Self

Observed one occurrence at time timestamp

Convenience method. Simply calls transmit

fn observed_one_value<V: Into<ObservedValue>>(
    &self,
    label: L,
    value: V,
    timestamp: Instant
) -> &Self

Observed one occurrence with value value at time timestamp

Convenience method. Simply calls transmit

fn observed_duration(
    &self,
    label: L,
    duration: Duration,
    timestamp: Instant
) -> &Self

Sends a Duration as an observed value observed at timestamp. The Duration is converted to nanoseconds.

fn observed_now(&self, label: L, count: u64) -> &Self

Observed count occurrences at now.

Convenience method. Simply calls observed with the current timestamp.

fn observed_one_now(&self, label: L) -> &Self

Observed one occurrence now

Convenience method. Simply calls observed_one with the current timestamp.

fn observed_one_value_now<V: Into<ObservedValue>>(
    &self,
    label: L,
    value: V
) -> &Self

Observed one occurrence with value value now

Convenience method. Simply calls observed_one_value with the current timestamp.

fn observed_one_duration_now(&self, label: L, duration: Duration) -> &Self

Sends a Duration as an observed value observed with the current timestamp.

The Duration is converted to nanoseconds internally.

fn measure_time(&self, label: L, from: Instant) -> &Self

Measures the time from from until now.

The resulting duration is an observed value with the measured duration in nanoseconds.

Loading content...

Implementors

impl<L: Send + 'static> TransmitsTelemetryData<L> for TelemetryTransmitter<L>[src]

Loading content...