[][src]Trait metrix::TransmitsTelemetryData

pub trait TransmitsTelemetryData<L> {
    fn transmit(&self, observation: Observation<L>) -> &Self;
fn add_handler(
        &self,
        handler: Box<dyn HandlesObservations<Label = L>>
    ) -> &Self;
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(
        &self,
        label: L,
        value: u64,
        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(&self, label: L, value: u64) -> &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 tranfer 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(&self, handler: Box<dyn HandlesObservations<Label = L>>) -> &Self

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 occurences at time timestamp

Convinience method. Simply calls transmit

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

Observed one occurence at time timestamp

Convinience method. Simply calls transmit

fn observed_one_value(&self, label: L, value: u64, timestamp: Instant) -> &Self

Observed one occurence with value value at time timestamp

Convinience 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 occurences at now.

Convinience method. Simply calls observed with the current timestamp.

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

Observed one occurence now

Convinience method. Simply calls observed_one with the current timestamp.

fn observed_one_value_now(&self, label: L, value: u64) -> &Self

Observed one occurence with value value now

Convinience 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.

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

Measures the time from from until now.

The resultiong 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...