Struct influent::measurement::Measurement [] [src]

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

Measurement model.

Fields

Key.

Timestamp.

Map of fields.

Map of tags.

Methods

impl<'a> Measurement<'a>
[src]

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

impl<'a> Debug for Measurement<'a>
[src]

Formats the value using the given formatter.