gping icon indicating copy to clipboard operation
gping copied to clipboard

Draft Feature: Histogram of Response Time

Open isosphere opened this issue 8 months ago • 1 comments

Current screenshot: (will update as I push changes)

image

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.

isosphere avatar Jun 08 '25 04:06 isosphere

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.

isosphere avatar Jun 24 '25 01:06 isosphere