pub struct WriteEntry {
pub timestamp: i64,
pub metric_name: String,
pub value: f64,
pub tags: HashMap<String, String>,
}Expand description
A time-series write entry that is replicated through the Raft log.
This is the high-level application-facing write primitive; it is
internally converted to a TsdbCommand::WriteDatapoint before being
proposed to the Raft log.
Fields§
§timestamp: i64Unix epoch milliseconds.
metric_name: StringMetric / series name.
value: f64Observed measurement value.
Optional tag key-value pairs for dimensionality.
Implementations§
Source§impl WriteEntry
impl WriteEntry
Sourcepub fn new(timestamp: i64, metric_name: impl Into<String>, value: f64) -> Self
pub fn new(timestamp: i64, metric_name: impl Into<String>, value: f64) -> Self
Create a new write entry with no tags.
Sourcepub fn with_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn with_tag(self, key: impl Into<String>, value: impl Into<String>) -> Self
Builder: add a single tag.
Builder: add multiple tags at once.
Sourcepub fn to_command(&self) -> TsdbCommand
pub fn to_command(&self) -> TsdbCommand
Convert to a TsdbCommand::WriteDatapoint for Raft replication.
Trait Implementations§
Source§impl Clone for WriteEntry
impl Clone for WriteEntry
Source§fn clone(&self) -> WriteEntry
fn clone(&self) -> WriteEntry
Returns a duplicate 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 Debug for WriteEntry
impl Debug for WriteEntry
Source§impl PartialEq for WriteEntry
impl PartialEq for WriteEntry
impl StructuralPartialEq for WriteEntry
Auto Trait Implementations§
impl Freeze for WriteEntry
impl RefUnwindSafe for WriteEntry
impl Send for WriteEntry
impl Sync for WriteEntry
impl Unpin for WriteEntry
impl UnsafeUnpin for WriteEntry
impl UnwindSafe for WriteEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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