diff --git a/src/influx.rs b/src/influx.rs index a128da4..e2e7e19 100644 --- a/src/influx.rs +++ b/src/influx.rs @@ -243,6 +243,7 @@ pub enum OwnedValue { Boolean(bool) } +#[derive(Clone)] pub struct OwnedMeasurement { pub key: &'static str, pub timestamp: Option, @@ -281,6 +282,11 @@ impl OwnedMeasurement { self.timestamp = Some(timestamp); self } + + pub fn set_tag(mut self, key: &'static str, value: &'static str) -> Self { + *self.tags.entry(key).or_insert(value) = value; + self + } } pub fn dur_nanos(d: ::std::time::Duration) -> i64 {