pub struct StatEvent {
pub name: String,
pub tags: BTreeMap<String, String>,
pub value: f64,
pub kind: StatKind,
}Expand description
A single stat datapoint with statsd-style semantics and named tags.
This is the wire type used both for local DogStatsD emission and for shipping batches from bridges/exits to the broker over RPC.
Fields§
§name: StringBTreeMap so that serialization is deterministic, which Mac authentication requires.
value: f64§kind: StatKindImplementations§
Source§impl StatEvent
impl StatEvent
pub fn counter(name: &str, tags: &[(&str, &str)], value: f64) -> Self
pub fn gauge(name: &str, tags: &[(&str, &str)], value: f64) -> Self
pub fn timer_ms(name: &str, tags: &[(&str, &str)], value: f64) -> Self
Sourcepub fn dogstatsd_line(&self) -> String
pub fn dogstatsd_line(&self) -> String
Encodes as a single DogStatsD line, e.g. bridge_bytes:1048576|c|#pool:hk,country:CN.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for StatEvent
impl<'de> Deserialize<'de> for StatEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for StatEvent
Auto Trait Implementations§
impl Freeze for StatEvent
impl RefUnwindSafe for StatEvent
impl Send for StatEvent
impl Sync for StatEvent
impl Unpin for StatEvent
impl UnsafeUnpin for StatEvent
impl UnwindSafe for StatEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more