console
console copied to clipboard
feat(console): add wake-to-poll histogram
- refactored MiniHistogram so wake to poll histogram can reuse some code from poll duration histogram
- added Percentiles widget so wake to poll can reuse code from poll duration histogram
for https://github.com/tokio-rs/console/issues/50
This PR is quite long with the refactoring, I can split it into two if that's better for reviewing
This is excellent work, thanks for getting started here! I think one thing to work out that may affect this PR is whether we want a histogram per task, or if we just want the history of the whole runtime.
I'm tempted to say both sound interesting... The full runtime histogram can help show the overall "health" or busy level. If things are starting to take longer and longer to be polled, it could imply the system has too much load. But knowing at an individual task level could also help understand, when load got high, or another few tasks ate up precious CPU time, that it delayed waking some specific task.
By keeping a log of all the events and timestamps in the "recording", we could always reconstruct either of these. So probably we also want to consider the cost of building these up per tasks and sending them over the wire...
All of my rambling didn't have any decisions, just musings, but hopefully with some joint thinking we'll quickly arrive at a proper balance. :)
@seanmonstar thank you for the thoughts! I agree with you that recording this data for both runtime and per task is useful here.
So probably we also want to consider the cost of building these up per tasks and sending them over the wire...
This is probably my main concern in keeping logs of events. Given that HdrHistograms are pretty small, another option would be to have another histogram in each TaskStats. What do you think about that idea?
As this PR was not progressing, a new PR was opened (#409) which implemented the new histogram. That PR has been merged, so I'll close this one.