Skip to content

Add options --ymin and --ymax for setting vertical scale#555

Open
ryanmjacobs wants to merge 1 commit into
orf:masterfrom
ryanmjacobs:axis-tuning-rebase
Open

Add options --ymin and --ymax for setting vertical scale#555
ryanmjacobs wants to merge 1 commit into
orf:masterfrom
ryanmjacobs:axis-tuning-rebase

Conversation

@ryanmjacobs

Copy link
Copy Markdown

Fixes #406.

I have been running a similar patch for a few months now. Having the y-axis start at zero is fairly important :) 1 I have been using the -0 flag pretty much all of the time.

Finally got around to cleaning up my code. I'm not super familiar with Rust, so let me know it there are any changes needed to make the code more idiomatic.


  • Add options --ymin and --ymax for setting vertical scale
  • Option -0 is an alias for --ymin=0
  • Ensures at least 1 ms of y-axis when using --ymin=0
    • (Relevant for sub-ms hosts, e.g. gping -0 127.0.0.1)
# gping --help
.
  --ymin <YMIN> Set vertical axis min (ms)
  --ymax <YMAX> Set vertical axis max (ms)
  -0            Equivalent to --ymin=0
.

Comparison (before=bottom, after=top) gping -b10 --ymin 0 --ymax 500 3.80.0.0
comparison

Footnotes

  1. https://xkcd.com/2023/

Option `-0` is an alias for `--ymin=0`
@bitwombat

bitwombat commented Jun 14, 2026

Copy link
Copy Markdown

This is great, thanks @ryanmjacobs . Much much easier to visually gauge how ping is going without the axis jumping all over the place.

Small bug: with --ymin=0 and --ymax=100, the top y-axis label is 94.284 ms, and the value bops around for the first few pings.

gping --ymin=0 --ymax=100 -n 1 -b 300 8.8.8.8
image

Also, the usage section in readme.md needs to be updated to include your new options.

Great stuff!

@bitwombat

Copy link
Copy Markdown

It's actually more subtle than just not being the right max value.

Set the watch interval really high to make it obvious:

gping --ymin=0 --ymax=100 -n 60 -b 300 8.8.8.8

Notice how the sample is 29.1ms, but shows up below the max value of 27.432ms on the y axis.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add command line options to for a fixed Y axis scale

2 participants