bp2008 / pingtracer

Graphical pinging and traceroute application. Ping Tracer continuously pings each network host between your computer and a given destination, helping identify the source of connectivity problems.
MIT License
271 stars 29 forks source link

Feature request: hard min & max for chart #47

Open fragtion opened 1 month ago

fragtion commented 1 month ago

At the moment the ping chart plots from 0ms latency up to around 500ms. In this case it can be difficult to see pings on the chart that are below 10ms, as barely anything is visible on the chart because most of the graph is just unused blank space.

Then if monitoring a host with high ping (eg 200ms), a large portion of the graph will be green but again a large portion unused blank space. Sometimes this is fine, but other times it is desirable to monitor latency fluctuation more zoomed within a particular range

So it would be nice to be able to specify a min and max range for a ping graph (hard set), and maybe even have an option to automatically determine this range (dynamically) on the fly also as well

bp2008 commented 1 month ago

Hi.

The "zooming" logic is indeed rather primitive but I don't think I will be changing it.

The bottom of the graph is always "0ms". This is not changeable in the current code. The top of the graph is somewhat variable and you can influence its max range by adjusting the "Worse threshold" setting.

The graph drawing code prefers for every 1 pixel of height to equal 1 millisecond (for simplicity), but if any of the pings in the current viewport had a response time too large to be represented at this 1x scale, the graph will zoom out linearly along the y axis in order to more accurately show the relation between the higher and lower ping times. The graph will not zoom in under any circumstance. If all your ping response times are 0-2ms for example and your graph window is 200px high, it will still only ever draw the ping lines 0-2 pixels tall.

The graph painting code takes the worse threshold value, multiplies it by 1.5, and uses this as a cap for the number of milliseconds the graph will consider for linear scaling purposes. In other words, if you assign a value of 10, and your graph is at least 15 pixels tall, then the graph should never zoom out causing you to lose visual precision. However this will also affect the color of the lines on the graph. Not a perfect system, I know, but I didn't want there to be an overwhelming number of options (kinda failed at that already didn't I LOL).