Trait metrix::TransmitsTelemetryData
[−]
[src]
pub trait TransmitsTelemetryData<L> { fn transmit(&self, observation: Observation<L>); fn add_handler(&self, handler: Box<HandlesObservations<Label = L>>); fn add_cockpit(&self, cockpit: Cockpit<L>); fn add_panel_to_cockpit(&self, cockpit_name: String, panel: Panel<L>); fn observed(&self, label: L, count: u64, timestamp: Instant) { ... } fn observed_one(&self, label: L, timestamp: Instant) { ... } fn observed_one_value(&self, label: L, value: u64, timestamp: Instant) { ... } fn observed_duration(
&self,
label: L,
duration: Duration,
timestamp: Instant
) { ... } fn observed_now(&self, label: L, count: u64) { ... } fn observed_one_now(&self, label: L) { ... } fn observed_one_value_now(&self, label: L, value: u64) { ... } fn observed_one_duration_now(&self, label: L, duration: Duration) { ... } fn measure_time(&self, label: L, from: Instant) { ... } }
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>)
Transit an observation to the backend.
fn add_handler(&self, handler: Box<HandlesObservations<Label = L>>)
Add a handler.
fn add_cockpit(&self, cockpit: Cockpit<L>)
Add a Copckpit
fn add_panel_to_cockpit(&self, cockpit_name: String, panel: Panel<L>)
Add a Panel
to a Cockpit
if that Cockpit
has the
given name.
Provided Methods
fn observed(&self, label: L, count: u64, timestamp: Instant)
Observed count
occurences at time timestamp
Convinience method. Simply calls transmit
fn observed_one(&self, label: L, timestamp: Instant)
Observed one occurence at time timestamp
Convinience method. Simply calls transmit
fn observed_one_value(&self, label: L, value: u64, timestamp: Instant)
Observed one occurence with value value
at time timestamp
Convinience method. Simply calls transmit
fn observed_duration(&self, label: L, duration: Duration, timestamp: Instant)
Sends a Duration
as an observed value observed at timestamp
.
The Duration
is converted to nanoseconds.
fn observed_now(&self, label: L, count: u64)
Observed count
occurences at now.
Convinience method. Simply calls observed
with
the current timestamp.
fn observed_one_now(&self, label: L)
Observed one occurence now
Convinience method. Simply calls observed_one
with
the current timestamp.
fn observed_one_value_now(&self, label: L, value: u64)
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)
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)
Measures the time from from
until now.
The resultiong duration is an observed value with the measured duration in nanoseconds.
Implementors
impl<L> TransmitsTelemetryData<L> for TelemetryTransmitter<L>
impl<L> TransmitsTelemetryData<L> for TelemetryTransmitterSync<L>