Struct telemetry::Service [−][src]
Implementations
impl Service
[src]
The Telemetry service.
The service is in charge of maintaining the data recorded by the histograms. Each application using telemetry needs one instance of the service (or more, but this should seldom be necessary). The data is stored and processed in a dedicated background thread and the memory is recollected only when the service is dropped.
Panics
The service will panic if an attempt is made to register two histograms with the same key.
pub fn new(is_active: bool) -> Service
[src]
Create a new instance of the service.
This immediately launches the thread owning the data.
If is_active
is false
, the service will immediately accept
records. Otherwise, the service will only start recording once
set_active(true)
has been called.
pub fn to_json(
&self,
what: Subset,
format: SerializationFormat,
sender: Sender<Json>
)
[src]
&self,
what: Subset,
format: SerializationFormat,
sender: Sender<Json>
)
Serialize all histograms as json, in a given format.
Panics
The service will panic if the sender is closed by the time serialization is complete.
pub fn set_active(&self, value: bool)
[src]
Make the service (in)active.
Any data recorded on a histogram while the service is inactive will be ignored.
pub fn is_active(&self) -> bool
[src]
Trait Implementations
impl Drop for Service
[src]
Upon death of the service, terminate the thread and recollect all owned memory.
Auto Trait Implementations
impl !RefUnwindSafe for Service
impl Send for Service
impl !Sync for Service
impl Unpin for Service
impl !UnwindSafe for Service
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>,