pub struct Measurement<'a> {
    pub key: &'a str,
    pub timestamp: Option<i64>,
    pub fields: BTreeMap<Cow<'a, str>, Value<'a>>,
    pub tags: BTreeMap<Cow<'a, str>, Cow<'a, str>>,
}
Expand description

Measurement model.

Fields

key: &'a str

Key.

timestamp: Option<i64>

Timestamp.

fields: BTreeMap<Cow<'a, str>, Value<'a>>

Map of fields.

tags: BTreeMap<Cow<'a, str>, Cow<'a, str>>

Map of tags.

Implementations

Constructs a new Measurement.

Examples
use influent::measurement::Measurement;

let measurement = Measurement::new("key");

Adds field to the measurement.

Examples
use influent::measurement::{Measurement, Value};

let mut measurement = Measurement::new("key");

measurement.add_field("field", Value::String("hello"));

Adds tag to the measurement.

Examples
use influent::measurement::{Measurement, Value};

let mut measurement = Measurement::new("key");

measurement.add_tag("tag", "value");

Sets the timestamp of the measurement. It should be unix timestamp in nanosecond

Examples
use influent::measurement::{Measurement, Value};

let mut measurement = Measurement::new("key");

measurement.set_timestamp(1434055562000000000)

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.