Struct hornet::client::metric::Metric
[−]
[src]
pub struct Metric<T> { /* fields omitted */ }
Singleton metric
Methods
impl<T: MetricType + Clone> Metric<T>
[src]
fn new(
name: &str,
init_val: T,
sem: Semantics,
unit: Unit,
shorthelp: &str,
longhelp: &str
) -> Result<Self, String>
[src]
name: &str,
init_val: T,
sem: Semantics,
unit: Unit,
shorthelp: &str,
longhelp: &str
) -> Result<Self, String>
Creates a new PCP MMV Metric
The result is an error if the length of name
, shorthelp
or longhelp
exceed 255 bytes.
fn val(&self) -> T
[src]
Returns the current value of the metric
fn set_val(&mut self, new_val: T) -> Result<()>
[src]
Sets the current value of the metric.
If the metric is exported using a client, the value is written to the relevant MMV file.
If the metric isn't exported, this method will still succeed and update the value.