Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messages #1150

Closed
mpenning opened this issue May 19, 2024 · 4 comments · Fixed by #1162
Closed

Improve error messages #1150

mpenning opened this issue May 19, 2024 · 4 comments · Fixed by #1162
Labels
enhancement New feature or request
Milestone

Comments

@mpenning
Copy link

Describe the feature you'd like

--min-round-duration and --max-round-duration

Sub-second float values for min and max round duration would be extremely useful. When packet loss is 1% or 2%, it takes a while to send enough packets at 1-second round-trip values. Allowing lower values would substantially increase the speed of detecting the actual packet loss percentage.

If --max-round-duration is set lower than --min-round-duration, --min-round-duration should automatically be set to the requested --max-round-duration value.

@fujiapple852
Copy link
Owner

fujiapple852 commented May 19, 2024

@mpenning both of these settings can be specified in various time units including ms, see example:

https://github.com/fujiapple852/trippy?tab=readme-ov-file#usage-examples

trip example.com -i 250ms -g 50ms

Aside: note the grace period setting exists, which you want wish to tweak as well to fully saturate the line.

Perhaps the Trippy help output could be improved to make this more discoverable?

@fujiapple852
Copy link
Owner

Regarding:

If --max-round-duration is set lower than --min-round-duration, --min-round-duration should automatically be set to the requested --max-round-duration value.

The current behaviour is to validate these values and error out if the max is lower than the min, which I think is reasonable behaviour. In general I prefer to avoid any “surprising” behaviour where the tool does something the user did not request.

@mpenning
Copy link
Author

@mpenning both of these settings can be specified in various time units including ms, see example:

https://github.com/fujiapple852/trippy?tab=readme-ov-file#usage-examples

trip example.com -i 250ms -g 50ms

Aside: note the grace period setting exists, which you want wish to tweak as well to fully saturate the line.

Perhaps the Trippy help output could be improved to make this more discoverable?

Yes, specifically I filed this bug after trying this:

$ trip -i 0.05 4.2.2.2
Error: invalid character at 1
$

I mistakenly assumed that a sub-second value was not possible... if you could return the same error as this one, it would be more clear...

$ trip -i 2 4.2.2.2
Error: time unit needed, for example 2sec or 2ms

@fujiapple852
Copy link
Owner

@mpenning this is improved in #1162, for the above example the error will now be:

$ trip -i 0.05 4.2.2.2
error: invalid value '0.05' for '--min-round-duration <MIN_ROUND_DURATION>': expected time unit (i.e. 100ms, 2s, 1000us)

For more information, try '--help'.

This covers all "duration" parameters, namely:

  • min_round_duration
  • max_round_duration
  • grace_duration
  • read_timeout
  • dns_timeout
  • tui_refresh_rate

@fujiapple852 fujiapple852 added enhancement New feature or request and removed triage labels May 29, 2024
@fujiapple852 fujiapple852 added this to the 0.11.0 milestone May 29, 2024
@fujiapple852 fujiapple852 self-assigned this May 29, 2024
fujiapple852 added a commit that referenced this issue Jun 4, 2024
fujiapple852 added a commit that referenced this issue Jun 4, 2024
@fujiapple852 fujiapple852 changed the title Float sub-second --min-round-duration and --max-round-duration Improve error messages Jun 4, 2024
@fujiapple852 fujiapple852 removed their assignment Jun 18, 2024
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 12, 2024
[0.11.0] - 2024-08-11

Added

- Added NAT detection for `IPv4/udp/dublin` ([#1104](fujiapple852/trippy#1104))
- Added public API ([#1192](fujiapple852/trippy#1192))
- Added support for NAT detection (`N`) column ([#1219](fujiapple852/trippy#1219))
- Added support for last icmp packet type (`T`) column ([#1105](fujiapple852/trippy#1105))
- Added support for last icmp packet code (`C`) column ([#1109](fujiapple852/trippy#1109))
- Added support for the probe failure count (`f`) column ([#1258](fujiapple852/trippy#1258))
- Added settings dialog tab hotkeys ([#1217](fujiapple852/trippy#1217))
- Added `--dns-ttl` flag to allow refreshing the reverse DNS
  results ([#1233](fujiapple852/trippy#1233))
- Added `--generate-man` flag for generating [ROFF](https://en.wikipedia.org/wiki/Roff_(software)) man
  page ([#85](fujiapple852/trippy#85))
- Added Ubuntu PPA package ([#859](fujiapple852/trippy#859))
- Added Chocolatey package ([#572](fujiapple852/trippy#572))

Changed

- [BREAKING CHANGE] Changed initial sequence to be `33434` ([#1203](fujiapple852/trippy#1203))
- [BREAKING CHANGE] Renamed `tui-max-[samples|flows]`
  as `max-[samples|flows]` ([#1187](fujiapple852/trippy#1187))
- Separated library and binary crates ([#1141](fujiapple852/trippy#1141))
- Record `icmp` packet code ([#734](fujiapple852/trippy#734))
- Transient error handling for `IPv4` on macOS, Linux &
  Windows ([#1255](fujiapple852/trippy#1255))
- Improved error messages ([#1150](fujiapple852/trippy#1150))
- Revamp the help dialog ([#1260](fujiapple852/trippy#1260))

Fixed

- Fixed `DestinationUnreachable` incorrectly assumed to come from target
  host ([#1225](fujiapple852/trippy#1225))
- Fixed incorrect target hop calculation ([#1226](fujiapple852/trippy#1226))
- Do not conflate `AddressInUse` and `AddrNotAvailable`
  errors ([#1246](fujiapple852/trippy#1246))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants