Draft Feature: Histogram of Response Time
Current screenshot: (will update as I push changes)
This draft PR is open for feedback.
I think the histogram gives a nice sense of the distribution of ping times in a way a time series plot doesn't. I'm pretty happy with how this is working for myself.
Shortcomings as of this writing:
- It could look better; some styling?
- It's sampling from all contacted hosts
- The x-axis isn't labelled
- It could be much more efficient[^1][^2]
- The bins are hardcoded and range from 1 ms to 1 second, which may not be appropriate in all situations
I think the last item should be fixed before this is merged, it's fairly long-hanging fruit.
[^1]: CPU: it recalculates the bin counts from scratch every time a sample is added
[^2]: Memory: it collects its own sample cache, which is redundant and possibly misleading, as DEFAULT_WINDOW_SIZE need not correspond with the time series chart extent at all.
I've added a toggle via a keypress of h. The histogram is disabled by default, though it will collect ping response samples in the background up to its default buffer size of 500.
The currently inefficient binning code is only active when the histogram is.