Struct bosun_emitter::Datum [] [src]

pub struct Datum<'a> {
    pub metric: &'a str,
    pub timestamp: i64,
    pub value: &'a str,
    pub tags: &'a Tags,
}

Represents a metric datum.

Fields

Metric name

Unix timestamp in either s or ms

Value as string representation

Tags for this metric datum

Methods

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

Creates a new metric datum with a specified timestamp in ms.

Creates a new metric datum with timestamp now.

Encodes a Datum to JSON as String.

Example

let mut tags = Tags::new();
tags.insert("host".to_string(), "test-vm".to_string());
let datum = Datum::new("lukas.tests.count", 1458066838, "1", &tags);
let json = datum.to_json().unwrap();

Trait Implementations

impl<'a> Encodable for Datum<'a>
[src]

Serialize a value using an Encoder.

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

Formats the value using the given formatter.