Struct metrix::TelemetryTransmitterSync
source · pub struct TelemetryTransmitterSync<L> { /* private fields */ }
Expand description
Transmits Observation
s to the backend and has the Sync
marker.
This is almost the same as the TelemetryTransmitter
.
Since a Sender
for a channel is not Sync
this
struct wraps the Sender
in an Arc<Mutex<_>>
so that
it can be shared between threads.
Trait Implementations§
source§impl<L: Clone> Clone for TelemetryTransmitterSync<L>
impl<L: Clone> Clone for TelemetryTransmitterSync<L>
source§fn clone(&self) -> TelemetryTransmitterSync<L>
fn clone(&self) -> TelemetryTransmitterSync<L>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<L> TransmitsTelemetryData<L> for TelemetryTransmitterSync<L>
impl<L> TransmitsTelemetryData<L> for TelemetryTransmitterSync<L>
source§fn transmit(&self, observation: Observation<L>) -> &Self
fn transmit(&self, observation: Observation<L>) -> &Self
Transit an observation to the backend.
source§fn add_handler(&self, handler: Box<dyn HandlesObservations<Label = L>>) -> &Self
fn add_handler(&self, handler: Box<dyn HandlesObservations<Label = L>>) -> &Self
Add a handler.
source§fn add_cockpit(&self, cockpit: Cockpit<L>) -> &Self
fn add_cockpit(&self, cockpit: Cockpit<L>) -> &Self
Add a
Copckpit
source§fn observed_one(&self, label: L, timestamp: Instant) -> &Self
fn observed_one(&self, label: L, timestamp: Instant) -> &Self
Observed one occurence at time
timestamp
Read moresource§fn observed_duration(
&self,
label: L,
duration: Duration,
timestamp: Instant
) -> &Self
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. Read moresource§fn observed_now(&self, label: L, count: u64) -> &Self
fn observed_now(&self, label: L, count: u64) -> &Self
Observed
count
occurences at now. Read moresource§fn observed_one_now(&self, label: L) -> &Self
fn observed_one_now(&self, label: L) -> &Self
Observed one occurence now Read more
source§fn observed_one_value_now(&self, label: L, value: u64) -> &Self
fn observed_one_value_now(&self, label: L, value: u64) -> &Self
Observed one occurence with value
value
now Read more