[][src]Module runng::stats

Runtime statistics

Statistics are organized as a tree. Starting at the root, nodes may have a child whose siblings are likewise children of the parent.

The lifetime of the children is bound to that of the root. This won't compile:

This example deliberately fails to compile
use runng::stats::*;
let mut child: Option<NngStatChild> = None;
{
    let root = NngStatRoot::new().unwrap();
    child = root.child();
}
println!("Name = {}", child.unwrap().name().unwrap());

Examples

use log::{debug};
use runng::{
    *,
    stats::NngStat,
    stats::NngStatRoot,
};

#[test]
fn stats_example() -> Result<()> {
    let stats = NngStatRoot::new()?;
    let child = stats.child().unwrap();
    for stat in child.iter() {
        debug!("{}", stat.name().unwrap());
    }
    Ok(())
}

Structs

Iter

Iterator over sibling statistics

NngStatChild
NngStatRoot

Root of tree of statistics snapshot.

Traits

NngStat