Struct hornet::client::metric::CountVector
[−]
[src]
pub struct CountVector { /* fields omitted */ }
A count vector for multiple strictly increasing integer values, in possibly varying increments
Internally uses an InstanceMetric<u64>
with Semantics::Counter
and
Count::One
scale, and 1
count dimension
Methods
impl CountVector
[src]
fn new(
name: &str,
init_val: u64,
instances: &[&str],
shorthelp_text: &str,
longhelp_text: &str
) -> Result<Self, String>
[src]
name: &str,
init_val: u64,
instances: &[&str],
shorthelp_text: &str,
longhelp_text: &str
) -> Result<Self, String>
Creates a new count vector with given instances and a single initial value
fn new_with_initvals(
name: &str,
instances_and_initvals: &[(&str, u64)],
shorthelp_text: &str,
longhelp_text: &str
) -> Result<Self, String>
[src]
name: &str,
instances_and_initvals: &[(&str, u64)],
shorthelp_text: &str,
longhelp_text: &str
) -> Result<Self, String>
Creates a new count vector with given pairs of an instance and it's initial value
fn val(&self, instance: &str) -> Option<u64>
[src]
Returns the current count of the instance
fn inc(&mut self, instance: &str, increment: u64) -> Option<Result<()>>
[src]
Increments the count of the instance by the given value
The wrapping Option
is None
if the instance wasn't found
fn up(&mut self, instance: &str) -> Option<Result<()>>
[src]
Increments the count of the instance by +1
The wrapping Option
is None
if the instance wasn't found
fn inc_all(&mut self, increment: u64) -> Result<()>
[src]
Increments the count of all instances by the given value
fn up_all(&mut self) -> Result<()>
[src]
Increments the count of all instances by +1
fn reset(&mut self, instance: &str) -> Option<Result<()>>
[src]
Resets the count of the instance to it's initial value that was passed when creating the vector
The wrapping Option
is None
if the instance wasn't found
fn reset_all(&mut self) -> Result<()>
[src]
Resets the count of all instances to it's initial value that was passed when creating the vector
fn indom(&self) -> &Indom
[src]
Internally created instance domain