[−][src]Module nng_async::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<()> { // https://github.com/nanomsg/nng/issues/841 let url = "inproc://test"; let factory = ProtocolFactory::default(); let _pusher = factory.pusher_open()?.listen(&url)?; let _puller = factory.puller_open()?.dial(&url)?; 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 |
Traits
NngStat |