pub struct Point {
pub timestamp: i64,
pub value: Value,
pub labels: BTreeMap<String, String>,
pub unit: Option<String>,
pub epoch: Option<String>,
}Expand description
One measurement of one member (§2.3): the series is the key, never a label (§2.12).
Fields§
§timestamp: i64The measurement time, Unix epoch milliseconds: when the value was taken, not when it was put (§2.12).
value: ValueThe measured value, tagged with its kind.
labels: BTreeMap<String, String>Context, never identity (§2.12). Left out when empty.
unit: Option<String>The member’s unit where the resource declares none (§2.5). A
declared telemetry.unit is authoritative, and a Point that
disagrees does not conform (§2.6).
epoch: Option<String>Its in-band epoch (§2.9). The runtime’s writer fills it with the owner’s instance id, or the member’s epoch, when it is left out on a counter or a histogram.
Implementations§
Source§impl Point
impl Point
Sourcepub fn new(timestamp_ms: i64, value: impl Into<Value>) -> Self
pub fn new(timestamp_ms: i64, value: impl Into<Value>) -> Self
A Point of value, measured at timestamp_ms (Unix epoch
milliseconds). zenkey::telemetry::point stamps one with the clock
now; this module reads no clock.
Sourcepub fn with_label(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_label( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
With the label name = value, context (§2.12).
Sourcepub fn with_epoch(self, epoch: impl Into<String>) -> Self
pub fn with_epoch(self, epoch: impl Into<String>) -> Self
With the in-band epoch epoch (§2.9). An owner rarely writes it: the
runtime’s writer does, and refuses one other than its own.
Sourcepub fn kind(&self) -> MetricKind
pub fn kind(&self) -> MetricKind
The Point’s tag (§2.5).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Point
impl<'de> Deserialize<'de> for Point
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>,
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Forget for Point
impl Freeze for Pointwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<f64>: Freeze,
PhantomData<u64>: Freeze,
*const LeafNode<String, String> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, String)>>: Freeze,
impl Move for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnsafeUnpin for Pointwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<f64>: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for Point
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more