Struct bosun_emitter::Metadata [] [src]

pub struct Metadata<'a> {
    pub metric: &'a str,
    pub rate: &'a str,
    pub unit: &'a str,
    pub description: &'a str,
}

Represents metric meta data.

Fields

metric: &'a str

Metric name

rate: &'a str

Metric rate type: [gauge, counter rate]

unit: &'a str

Metric unit

description: &'a str

Metric description

Methods

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

fn new(metric: &'a str, rate: &'a str, unit: &'a str, description: &'a str) -> Metadata<'a>

Creates new metric meta data.

fn to_json(&self) -> Result<StringEmitterError>

Encodes Metadata to JSON as String.

Example

let metadata = Metadata::new("lukas.tests.count", "counter", "Tests", "Amount of Lukas Tests");
let json = metadata.to_json().unwrap();

Trait Implementations

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

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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

fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>