introduce metrics::intervals, sliding time aggregate statistics
use nostacksize_t to evolve deprecated APIs
omit needless namespace refs; use nullopt
test metrics::intervals