[][src]Function stats::thread_local_aggregator::schedule_stats_aggregation

pub fn schedule_stats_aggregation() -> Result<Scheduler, StatsScheduledError>

Upon the first call to this function it will return a future that results in periodically calling aggregation of stats. On subsequent calls it will return Error::StatsScheduled that contain the future, so that the caller might still use it, but knows that it is not the first this function was called.

Examples

use futures_old::Future;
use stats::schedule_stats_aggregation;
use tokio_old::executor::spawn;

let s = schedule_stats_aggregation().unwrap();
spawn(s.map_err(|e| panic!("Stats problem: {:?}", e)));