future-timed
Future timing instrumentation for Rust async code.
Overview
future-timed provides instrumentation to record the time taken by a future. It
tracks the busy time which is the sum of all time consumed during calls to
Future::poll on the future and the idle time which is The sum of all time
between calls to Future::poll (excluding time before first poll)
Installation
Add future-timed to your Cargo.toml:
= "0.1"
Usage
Use the TimedFutureExt extension trait to add timing instrumentation to any future:
use ;
async
You can also use the standalone timed function:
use ;
async
Composability
Unlike similar crates, future-timed allows you to report timing data inline
and compose with subsequent future combinators:
use ;
use FutureExt;
async
Note that in this case, timing data is for all wrapped futures.
License
This project is licensed under the MIT license.
Credits
Based on the future-timing crate but with a different API.