From d50d54f493eb956eb27bb0b8f7c71b38bf02495e Mon Sep 17 00:00:00 2001 From: r3inbowari Date: Wed, 15 May 2024 18:27:59 +0800 Subject: [PATCH] Release v1.7.6 (#214) --- README.md | 17 +++++++++++------ speedtest.go | 2 +- speedtest/speedtest.go | 2 +- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6674e5e..0ec0016 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Flags: -s, --server=SERVER ... Select server id to speedtest. --custom-url=CUSTOM-URL Specify the url of the server instead of fetching from speedtest.net. --saving-mode Test with few resources, though low accuracy (especially > 30Mbps). - --json Output results in json like format. + --json Output results in json format. --unix Output results in unix like format. --location=LOCATION Change the location with a precise coordinate (format: lat,lon). --city=CITY Change the location with a predefined city label. @@ -73,13 +73,14 @@ Simply use `speedtest` command. The closest server is selected by default. Use t # speedtest --unix $ speedtest - speedtest-go v1.7.3 @showwin + speedtest-go v1.7.6 @showwin ✓ ISP: 124.27.199.165 (Fujitsu) [34.9769, 138.3831] ✓ Found 20 Public Servers ✓ Test Server: [6691] 9.03km Shizuoka (Japan) by sudosan ✓ Latency: 4.452963ms Jitter: 41.271µs Min: 4.395179ms Max: 4.517576ms +✓ Packet Loss Analyzer: Running in background (<= 30 Secs) ✓ Download: 115.52 Mbps (Used: 135.75MB) (Latency: 4ms Jitter: 0ms Min: 4ms Max: 4ms) ✓ Upload: 4.02 Mbps (Used: 6.85MB) (Latency: 4ms Jitter: 1ms Min: 3ms Max: 8ms) ✓ Packet Loss: 8.82% (Sent: 217/Dup: 0/Max: 237) @@ -104,7 +105,7 @@ and select them by id. ```bash $ speedtest --server 6691 --server 6087 - speedtest-go v1.7.3 @showwin + speedtest-go v1.7.6 @showwin ✓ ISP: 124.27.199.165 (Fujitsu) [34.9769, 138.3831] ✓ Found 2 Specified Public Server(s) @@ -228,17 +229,21 @@ func main() { targets, _ := serverList.FindServer([]int{}) // Create a packet loss analyzer, use default options - analyzer, err := speedtest.NewPacketLossAnalyzer(nil) - checkError(err) + analyzer := speedtest.NewPacketLossAnalyzer(nil) // Perform packet loss analysis on all available servers for _, server := range targets { - err = analyzer.Run(server.Host, func(packetLoss *transport.PLoss) { + err := analyzer.Run(server.Host, func(packetLoss *transport.PLoss) { fmt.Println(packetLoss, server.Host, server.Name) // fmt.Println(packetLoss.Loss()) }) checkError(err) } + + // or test all at the same time. + packetLoss, err := analyzer.RunMulti(targets.Hosts()) + checkError(err) + fmt.Println(packetLoss) } ``` diff --git a/speedtest.go b/speedtest.go index fcd1497..7cfa222 100644 --- a/speedtest.go +++ b/speedtest.go @@ -22,7 +22,7 @@ var ( serverIds = kingpin.Flag("server", "Select server id to run speedtest.").Short('s').Ints() customURL = kingpin.Flag("custom-url", "Specify the url of the server instead of fetching from speedtest.net.").String() savingMode = kingpin.Flag("saving-mode", "Test with few resources, though low accuracy (especially > 30Mbps).").Bool() - jsonOutput = kingpin.Flag("json", "Output results in json like format.").Bool() + jsonOutput = kingpin.Flag("json", "Output results in json format.").Bool() unixOutput = kingpin.Flag("unix", "Output results in unix like format.").Bool() location = kingpin.Flag("location", "Change the location with a precise coordinate (format: lat,lon).").String() city = kingpin.Flag("city", "Change the location with a predefined city label.").String() diff --git a/speedtest/speedtest.go b/speedtest/speedtest.go index 94f1faa..aca161a 100644 --- a/speedtest/speedtest.go +++ b/speedtest/speedtest.go @@ -13,7 +13,7 @@ import ( ) var ( - version = "1.7.5" + version = "1.7.6" DefaultUserAgent = fmt.Sprintf("showwin/speedtest-go %s", version) )