[][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 add_panel_to_cockpit(
        &self,
        cockpit_name: String,
        panel: Panel<L>
    ) -> &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

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

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

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> TransmitsTelemetryData<L> for TelemetryTransmitter<L>[src]

impl<L> TransmitsTelemetryData<L> for TelemetryTransmitterSync<L>[src]

Loading content...