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

chore(deps): Bump github.com/showwin/speedtest-go from 1.7.5 to 1.7.6 #15362

Merged
merged 3 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ require (
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/sensu/sensu-go/api/core/v2 v2.16.0
github.com/shirou/gopsutil/v3 v3.24.4
github.com/showwin/speedtest-go v1.7.5
github.com/showwin/speedtest-go v1.7.6
github.com/signalfx/golib/v3 v3.3.53
github.com/sirupsen/logrus v1.9.3
github.com/sleepinggenius2/gosmi v0.4.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,8 @@ github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9Nz
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/showwin/speedtest-go v1.7.5 h1:FQ3EdM2vnfw5BRCRzGCYe8aWu70rr21Az5ZFHiW9CdE=
github.com/showwin/speedtest-go v1.7.5/go.mod h1:uLgdWCNarXxlYsL2E5TOZpCIwpgSWnEANZp7gfHXHu0=
github.com/showwin/speedtest-go v1.7.6 h1:wBbj4aJR+kq+DP44ja3hWEc50FCiSk0U0YQ9xQLORd0=
github.com/showwin/speedtest-go v1.7.6/go.mod h1:uLgdWCNarXxlYsL2E5TOZpCIwpgSWnEANZp7gfHXHu0=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 h1:32k2QLgsKhcEs55q4REPKyIadvid5FPy2+VMgvbmKJ0=
github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3/go.mod h1:gJrXWi7wSGXfiC7+VheQaz+ypdCt5SmZNL+BRxUe7y4=
Expand Down
19 changes: 7 additions & 12 deletions plugins/inputs/internet_speed/internet_speed.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (is *InternetSpeed) Gather(acc telegraf.Accumulator) error {
SamplingDuration: time.Second * 15,
})

pLoss := -1.0
var pLoss *transport.PLoss

if is.TestMode == testModeMulti {
err = is.server.MultiDownloadTestContext(context.Background(), is.servers)
Expand Down Expand Up @@ -117,30 +117,25 @@ func (is *InternetSpeed) Gather(acc telegraf.Accumulator) error {
}
// Not all servers are applicable for packet loss testing.
// If err != nil, we skip it and just report a warning.
err = analyzer.Run(is.server.Host, func(packetLoss *transport.PLoss) {
if packetLoss != nil && packetLoss.Sent != 0 {
pLoss = packetLoss.Loss()
}
err = analyzer.Run(is.server.Host, func(pl *transport.PLoss) {
pLoss = pl
})
if err != nil {
is.Log.Warnf("packet loss test failed: %s", err)
}
}

lossPercent := 0.0
if pLoss == -1 {
// If all servers are not applicable, returned -1.
lossPercent = -1
} else {
lossPercent = pLoss * 100.0
packetLoss := -1.0
if pLoss != nil {
packetLoss = pLoss.LossPercent()
}

fields := map[string]any{
"download": is.server.DLSpeed.Mbps(),
"upload": is.server.ULSpeed.Mbps(),
"latency": timeDurationMillisecondToFloat64(is.server.Latency),
"jitter": timeDurationMillisecondToFloat64(is.server.Jitter),
"packet_loss": lossPercent,
"packet_loss": packetLoss,
"location": is.server.Name,
}
tags := map[string]string{
Expand Down
Loading