chore(deps): Bump github.com/showwin/speedtest-go from 1.6.6 to 1.6.7 (#14250)
Co-authored-by: Josh Powers <powersj@fastmail.com> Co-authored-by: r3inbowari <r3inbowari@gmail.com>
This commit is contained in:
parent
87ca7b2719
commit
d644ffd3d2
2
go.mod
2
go.mod
|
|
@ -165,7 +165,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.23.9
|
||||
github.com/showwin/speedtest-go v1.6.6
|
||||
github.com/showwin/speedtest-go v1.6.7
|
||||
github.com/signalfx/golib/v3 v3.3.53
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/sleepinggenius2/gosmi v0.4.4
|
||||
|
|
|
|||
4
go.sum
4
go.sum
|
|
@ -2084,8 +2084,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.6.6 h1:WPq8vhD1aHzt23hJA+wHe3MLOXsVrMMOjU2UO98pOSc=
|
||||
github.com/showwin/speedtest-go v1.6.6/go.mod h1:uLgdWCNarXxlYsL2E5TOZpCIwpgSWnEANZp7gfHXHu0=
|
||||
github.com/showwin/speedtest-go v1.6.7 h1:U0uMD9v4QS2JEqBoCHPWYQ1S9f87AnSSl5WsT+sBX6c=
|
||||
github.com/showwin/speedtest-go v1.6.7/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=
|
||||
|
|
|
|||
|
|
@ -121,9 +121,14 @@ func (is *InternetSpeed) Gather(acc telegraf.Accumulator) error {
|
|||
}
|
||||
|
||||
func (is *InternetSpeed) findClosestServer() error {
|
||||
proto := speedtest.HTTP
|
||||
if os.Getegid() <= 0 {
|
||||
proto = speedtest.ICMP
|
||||
}
|
||||
|
||||
client := speedtest.New(speedtest.WithUserConfig(&speedtest.UserConfig{
|
||||
UserAgent: internal.ProductToken(),
|
||||
ICMP: os.Geteuid() == 0 || os.Geteuid() == -1,
|
||||
PingMode: proto,
|
||||
SavingMode: is.MemorySavingMode,
|
||||
}))
|
||||
if is.Connections > 0 {
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ func TestGathering(t *testing.T) {
|
|||
MemorySavingMode: true,
|
||||
Log: testutil.Logger{},
|
||||
}
|
||||
require.NoError(t, internetSpeed.Init())
|
||||
|
||||
acc := &testutil.Accumulator{}
|
||||
|
||||
require.NoError(t, internetSpeed.Gather(acc))
|
||||
}
|
||||
|
||||
|
|
@ -29,16 +29,12 @@ func TestDataGen(t *testing.T) {
|
|||
MemorySavingMode: true,
|
||||
Log: testutil.Logger{},
|
||||
}
|
||||
require.NoError(t, internetSpeed.Init())
|
||||
|
||||
acc := &testutil.Accumulator{}
|
||||
require.NoError(t, internetSpeed.Gather(acc))
|
||||
|
||||
metric, ok := acc.Get("internet_speed")
|
||||
require.True(t, ok)
|
||||
|
||||
tags := metric.Tags
|
||||
|
||||
fields := metric.Fields
|
||||
|
||||
acc.AssertContainsTaggedFields(t, "internet_speed", fields, tags)
|
||||
acc.AssertContainsTaggedFields(t, "internet_speed", metric.Fields, metric.Tags)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue