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

Infinite ping #86

Merged
merged 27 commits into from
Feb 15, 2024
Merged

Infinite ping #86

merged 27 commits into from
Feb 15, 2024

Conversation

radulucut
Copy link
Collaborator

@radulucut radulucut commented Jan 17, 2024

Adds support for the --infinite flag on the ping command.

  • --limit will be set to max 5 when used with --infinite
  • --packets default to 16 when --infinite is used
Example
globalping ping cdn.jsdelivr.net from Europe --infinite
> EU, SE, Stockholm, ASN:42708, GleSYS AB
PING  (142.250.186.46) 56(84) bytes of data.
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=1 ttl=59 time=25.2 ms
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=2 ttl=59 time=24.9 ms
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=3 ttl=59 time=25.2 ms
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=4 ttl=59 time=25.6 ms
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=5 ttl=59 time=28.2 ms
64 bytes from fra24s04-in-f14.1e100.net (142.250.186.46): icmp_seq=6 ttl=59 time=31.5 ms
^C
Example - multiple locations
globalping ping google.com from Europe --limit 5 --infinite
Location                                                  | Sent |    Loss |     Last |      Min |      Avg |      Max
EU, IT, Milan, ASN:16509, Amazon.com, Inc.                |    8 |   0.00% |  0.68 ms |  0.66 ms |  0.69 ms |  0.74 ms
EU, GB, London, ASN:20473, The Constant Company, LLC      |    7 |   0.00% |  1.25 ms |  1.24 ms |  1.29 ms |  1.35 ms
EU, DE, Essen, ASN:6805, Telefonica Germany GmbH & Co.OHG |    8 |   0.00% |  24.5 ms |  24.5 ms |  25.0 ms |  25.8 ms
EU, NO, Oslo, ASN:63473, HostHatch, LLC                   |    8 |   0.00% |  7.88 ms |  7.88 ms |  7.94 ms |  8.07 ms
EU, FR, Roubaix, ASN:16276, OVH SAS                       |    7 |   0.00% |  4.19 ms |  4.18 ms |  4.22 ms |  4.26 ms
^C

@jimaek
Copy link
Member

jimaek commented Jan 17, 2024

Looks good, I think we could use this for the comparison feature as well. e.g. if user provides 2 endpoints then automatically use this formatting. @MartinKolarik what do you think?

@MartinKolarik

This comment was marked as outdated.

README.md Outdated Show resolved Hide resolved
@jimaek

This comment was marked as outdated.

@MartinKolarik

This comment was marked as off-topic.

@jimaek
Copy link
Member

jimaek commented Jan 18, 2024

Regarding the PR itself, currently, in single probe mode, there is a delay that makes it look like it's stuck until it updates again. It should look more like normal ping, which looks and feels real-time. If there's a refresh delay then lets lower it.

The summary mode looks good on my environment.

@jimaek
Copy link
Member

jimaek commented Jan 18, 2024

Please also follow the same format https://share.perfstack.net/2024/01/Termius_2024-01-18_18-02-14.png

@jimaek

This comment was marked as resolved.

@radulucut

This comment was marked as resolved.

@radulucut
Copy link
Collaborator Author

Multi-location live updates do not seem to work properly on Git Bash (I've raised an issue here), it appends a new table on every refresh.
Should I find an alternative or we can live with it for now?

@MartinKolarik
Copy link
Member

MartinKolarik commented Jan 19, 2024

Multi-location live updates do not seem to work properly on Git Bash (I've raised an issue pterm/pterm#616), it appends a new table on every refresh.

I don't have this issue, it only happened when I resized the terminal while the command was running. Without resizing, it worked fine.

view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/view.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
cmd/ping.go Outdated Show resolved Hide resolved
@radulucut radulucut marked this pull request as ready for review January 26, 2024 10:51
Copy link
Member

@MartinKolarik MartinKolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting to look good! Haven't fully reviewed the code yet, but writing down what I've got so far.

cmd/ping.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
view/latency.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
Copy link
Member

@MartinKolarik MartinKolarik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting there 😄 please check the three small issues first, then let's see if we can improve the concurrency handling in a separate commit.

view/infinite.go Outdated Show resolved Hide resolved
view/infinite.go Outdated Show resolved Hide resolved
cmd/ping.go Outdated Show resolved Hide resolved
cmd/ping.go Outdated Show resolved Hide resolved
@MartinKolarik
Copy link
Member

@jimaek please retest as well.

@MartinKolarik MartinKolarik changed the title [WIP] Infinite ping Infinite ping Feb 15, 2024
@MartinKolarik MartinKolarik merged commit 6022008 into jsdelivr:master Feb 15, 2024
3 checks passed
@MartinKolarik
Copy link
Member

Merging, let's continue in #91.

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.

3 participants