Struct metrix::processor::TelemetryProcessor [−][src]
The counterpart of the TelemetryTransmitter
. It receives the
Observation
s and other messages and processes them.
A TelemetryProcessor
is tied to a specific kind of label
which is used to determine which metrics are triggered.
The TelemetryProcessor<L>
owns a Receiver
for TelemetryMessage<L>
.
Implementations
impl<L> TelemetryProcessor<L> where
L: Clone + Eq + Send + 'static,
[src]
L: Clone + Eq + Send + 'static,
pub fn new_pair<T: Into<String>>(
name: T
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
[src]
name: T
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
Creates a TelemetryTransmitter
and the corresponding
TelemetryProcessor
The name
will cause a grouping in the Snapshot
.
It is important that the returned TelemetryProcessor
gets mounted on a driver soon
since otherwise the internal queue will get flooded
with unprocessed observations
pub fn new_pair_bounded<T: Into<String>>(
name: T,
cap: usize,
block_on_full: bool
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
[src]
name: T,
cap: usize,
block_on_full: bool
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
Creates a TelemetryTransmitter
and the corresponding
TelemetryProcessor
The name
will cause a grouping in the Snapshot
.
The message queue will be bound to cap
elements.
If block_on_full
is false
messages will be dropped if cap
elements are in the queue.
pub fn new_pair_without_name(
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
[src]
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
Creates a TelemetryTransmitter
and the corresponding
TelemetryProcessor
No grouping will occur unless the name is set.
It is important that the returned TelemetryProcessor
gets mounted on a driver soon
since otherwise the internal queue will get flooded
with unprocessed observations
pub fn new_pair_bounded_without_name(
cap: usize,
block_on_full: bool
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
[src]
cap: usize,
block_on_full: bool
) -> (TelemetryTransmitter<L>, TelemetryProcessor<L>)
Creates a TelemetryTransmitter
and the corresponding
TelemetryProcessor
The name
will cause a grouping in the Snapshot
.
The message queue will be bound to cap
elements.
If block_on_full
is false
messages will be dropped if cap
elements are in the queue.
pub fn add_cockpit(&mut self, cockpit: Cockpit<L>)
[src]
Add a Cockpit
If the cockpit has a name and another cockpit with the same name is already present the cockpit will not be added.
pub fn cockpit(self, cockpit: Cockpit<L>) -> Self
[src]
Add a Cockpit
If the cockpit has a name and another cockpit with the same name is already present the cockpit will not be added.
pub fn get_cockpits(&self) -> Vec<&Cockpit<L>>
[src]
Returns all contained Cockpit
s
pub fn add_handler<T: HandlesObservations<Label = L>>(&mut self, handler: T)
[src]
Add a (custom) handler for Observation
s.
pub fn handler<T: HandlesObservations<Label = L>>(self, handler: T) -> Self
[src]
Add a (custom) handler for Observation
s.
pub fn get_handlers(&self) -> Vec<&dyn HandlesObservations<Label = L>>
[src]
Returns all the handlers
pub fn add_snapshooter<S: PutsSnapshot>(&mut self, snapshooter: S)
[src]
Add a snapshooter that simply creates some Snapshot
defined
by it’s internal logic. Usually it polls something when a
Snapshot
is requested.
pub fn snapshooter<S: PutsSnapshot>(self, snapshooter: S) -> Self
[src]
Add a snapshooter that simply creates some Snapshot
defined
by it’s internal logic. Usually it polls something when a
Snapshot
is requested.
pub fn get_snapshooters(&self) -> Vec<&dyn PutsSnapshot>
[src]
pub fn get_name(&self) -> Option<&str>
[src]
pub fn set_name<T: Into<String>>(&mut self, name: T)
[src]
Sets the name which will cause a grouoing in the Snapshot
pub fn set_inactivity_limit(&mut self, limit: Duration)
[src]
Sets the maximum amount of time this processor may be inactive until no more snapshots are taken
pub fn inactivity_limit(self, limit: Duration) -> Self
[src]
Sets the maximum amount of time this processor may be inactive until no more snapshots are taken
pub fn set_show_activity_state(&mut self, show: bool)
[src]
Set whether to show if the processor is inactive or not
if inactivity_limit
is set.
The default is true
. Only has an effect if a inactivity_limit
is set.
pub fn show_activity_state(self, show: bool) -> Self
[src]
Set whether to show if the processor is inactive or not
if inactivity_limit
is set.
The default is true
. Only has an effect if a inactivity_limit
is set.
Trait Implementations
impl<L> Descriptive for TelemetryProcessor<L>
[src]
impl<L> ProcessesTelemetryMessages for TelemetryProcessor<L> where
L: Clone + Eq + Send + 'static,
[src]
L: Clone + Eq + Send + 'static,
fn process(
&mut self,
max: usize,
strategy: ProcessingStrategy
) -> ProcessingOutcome
[src]
&mut self,
max: usize,
strategy: ProcessingStrategy
) -> ProcessingOutcome
impl<L> PutsSnapshot for TelemetryProcessor<L> where
L: Clone + Eq + Send + 'static,
[src]
L: Clone + Eq + Send + 'static,
fn put_snapshot(&self, into: &mut Snapshot, descriptive: bool)
[src]
Auto Trait Implementations
impl<L> !RefUnwindSafe for TelemetryProcessor<L>
impl<L> Send for TelemetryProcessor<L> where
L: Send,
L: Send,
impl<L> !Sync for TelemetryProcessor<L>
impl<L> Unpin for TelemetryProcessor<L> where
L: Unpin,
L: Unpin,
impl<L> !UnwindSafe for TelemetryProcessor<L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,