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<String, EmitterError>
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();