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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f577a85
Add --infinite flag
radulucut Jan 15, 2024
3bbc717
Add infinite output view & refactoring
radulucut Jan 17, 2024
ca86281
Fix Sent count
radulucut Jan 17, 2024
b5da380
More docs
jimaek Jan 17, 2024
b9e9d4e
Add tests + refactoring
radulucut Jan 18, 2024
20c83e7
Update formating, fix test
radulucut Jan 18, 2024
0c774f7
Fix test
radulucut Jan 18, 2024
1ae9a0f
Update Go version and dependencies
radulucut Jan 19, 2024
f527b86
Update table format
radulucut Jan 19, 2024
a99d83d
Add table truncation
radulucut Jan 23, 2024
2e3e18d
Fix limit flag
radulucut Jan 23, 2024
a291e5f
Parse and handle in-progress measurement
radulucut Jan 25, 2024
225d384
Add more tests
radulucut Jan 26, 2024
45d9151
Add support for share & summary + fixes & tests
radulucut Jan 30, 2024
8542e5a
Add combined mdev, change --infinite + --latency
radulucut Jan 31, 2024
180a8ba
Update ping.go
MartinKolarik Feb 2, 2024
3ca1801
Update mdev logic & term padding, fix history
radulucut Feb 5, 2024
940e0a4
Fix tests
radulucut Feb 5, 2024
416ea8f
Refactor code structure to improve testability
radulucut Feb 6, 2024
c741fd5
Add printer
radulucut Feb 7, 2024
7881888
Refactoring, ping tests & fixes
radulucut Feb 7, 2024
ea5c2b8
Skip test on windows
radulucut Feb 7, 2024
96a19a8
Update actions
MartinKolarik Feb 12, 2024
877c51a
Handle failed measurements
radulucut Feb 12, 2024
5d3121e
Add time for in progress measurements
radulucut Feb 13, 2024
b80540d
Replace github.com/golang/mock with go.uber.org/mock
radulucut Feb 13, 2024
9be6fae
Update sleep durations in ping_test.go
radulucut Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
# run only against tags
tags:
- '*'
- "*"

permissions:
contents: write
Expand All @@ -15,19 +15,19 @@ jobs:
goreleaser:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags

- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version: '>=1.20.0'
go-version: ">=1.21.3"
cache: true

- uses: goreleaser/goreleaser-action@v4
with:
version: v1.20.0
version: v1.21.3
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN_GORELEASER }}
Expand All @@ -50,7 +50,7 @@ jobs:
path: |
dist/globalping_Windows_arm64.zip
dist/globalping_Windows_x86_64.zip
dist/globalping_Windows_i386.zip
dist/globalping_Windows_i386.zip

deploy:
needs: goreleaser
Expand All @@ -65,7 +65,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: goreleaser-windows

- run: echo "VERSION_NAME=${GITHUB_REF_NAME:1}" >> $GITHUB_ENV
- run: ls -la

Expand All @@ -82,7 +82,7 @@ jobs:
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: jsdelivr.Globalping
installers-regex: 'Windows_(arm64|x86_64|i386).zip'
installers-regex: "Windows_(arm64|x86_64|i386).zip"
version: ${{ env.VERSION_NAME }}
max-versions-to-keep: 5
token: ${{ secrets.GHTOKEN_WINGET }}
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
strategy:
fail-fast: false
matrix:
go: ["1.20"]
go: ["1.21"]
os: [ubuntu-latest, macOS-latest, windows-latest]
name: ${{ matrix.os }} Go ${{ matrix.go }} Tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
cache: true
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Hi! We're really excited that you're interested in contributing! Before submitti

## General guidelines

- Bug fixes and changes discussed in the existing issues are always welcome.
- For new ideas, please open an issue to discuss them before sending a PR.
- Make sure your PR passes `npm test` and has [appropriate commit messages](https://github.com/jsdelivr/globalping-cli/commits/master).
- Bug fixes and changes discussed in the existing issues are always welcome.
- For new ideas, please open an issue to discuss them before sending a PR.
- Make sure your PR passes `go test ./...` and has [appropriate commit messages](https://github.com/jsdelivr/globalping-cli/commits/master).

## Project setup

Expand All @@ -19,7 +19,7 @@ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/insta
Install mockgen:

```shell
GOBIN=$(pwd)/bin go install github.com/golang/mock/mockgen@v1.6.0
GOBIN=$(pwd)/bin go install go.uber.org/mock/mockgen@latest
```

Run golangci-lint:
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,37 @@ Max: 7.413 ms
Avg: 7.359 ms
```

#### Continuous non-stop measurements

> [!IMPORTANT]
> Currently this feature is limited to the ping command

You can use the `--infinite` flag to continuously ping a host, just like on Linux or MacOS.
Note that while it looks like a single measurement, in actuality its multiple measurements from the same probes combined into a single output.
This means that eventually you will run out of credits and the test will stop.

```bash
globalping ping cdn.jsdelivr.net from Europe --infinite
> EU, GB, London, ASN:40676, Psychz Networks
PING cdn.jsdelivr.net (151.101.1.229) 56(84) bytes of data.
64 bytes from 151.101.1.229 (151.101.1.229): icmp_seq=1 ttl=59 time=0.54 ms
64 bytes from 151.101.1.229 (151.101.1.229): icmp_seq=2 ttl=59 time=0.42 ms
^C
```

If you select multiple probes when using `--infinite` the output will change to a summary comparison table.

```bash
globalping ping cdn.jsdelivr.net from Europe --limit 5 --infinite
Location | Sent | Loss | Last | Min | Avg | Max
EU, GB, London, ASN:16276, OVH SAS | 22 | 0.00% | 3.33 ms | 3.07 ms | 3.20 ms | 3.33 ms
EU, DE, Falkenstein, ASN:24940, Hetzner Online GmbH | 22 | 0.00% | 5.41 ms | 5.30 ms | 5.78 ms | 13.1 ms
EU, AT, Vienna, ASN:57169, EDIS GmbH | 22 | 0.00% | 0.47 ms | 0.46 ms | 0.56 ms | 0.88 ms
EU, SE, Stockholm, ASN:20473, The Constant Company, LLC | 22 | 0.00% | 1.03 ms | 0.83 ms | 1.15 ms | 4.66 ms
EU, ES, Madrid, ASN:47787, EDGOO NETWORKS LLC | 22 | 0.00% | 0.24 ms | 0.13 ms | 0.26 ms | 0.42 ms
jimaek marked this conversation as resolved.
Show resolved Hide resolved
^C
```

#### Learn about available flags

Most commands have shared and unique flags. We recommend that you familiarize yourself with these so that you can run and automate your network tests in powerful ways.
Expand Down
107 changes: 0 additions & 107 deletions client/client.go

This file was deleted.

124 changes: 0 additions & 124 deletions client/measurements_fetcher.go

This file was deleted.

Loading