Skip to content

Commit

Permalink
chore(deps): Bump upgrade github.com/shirou/gopsutil from v3.24.4 to …
Browse files Browse the repository at this point in the history
…v4.24.9 (#16023)
  • Loading branch information
zmyzheng authored Oct 15, 2024
1 parent e5f194b commit 67f655b
Show file tree
Hide file tree
Showing 30 changed files with 60 additions and 53 deletions.
1 change: 1 addition & 0 deletions docs/LICENSE_OF_DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ following works:
- github.com/eapache/go-resiliency [MIT License](https://github.com/eapache/go-resiliency/blob/master/LICENSE)
- github.com/eapache/go-xerial-snappy [MIT License](https://github.com/eapache/go-xerial-snappy/blob/master/LICENSE)
- github.com/eapache/queue [MIT License](https://github.com/eapache/queue/blob/master/LICENSE)
- github.com/ebitengine/purego [Apache License 2.0](https://github.com/ebitengine/purego/blob/main/LICENSE)
- github.com/eclipse/paho.golang [Eclipse Public License - v 2.0](https://github.com/eclipse/paho.golang/blob/master/LICENSE)
- github.com/eclipse/paho.mqtt.golang [Eclipse Public License - v 2.0](https://github.com/eclipse/paho.mqtt.golang/blob/master/LICENSE)
- github.com/emicklei/go-restful [MIT License](https://github.com/emicklei/go-restful/blob/v3/LICENSE)
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ require (
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/seancfoley/ipaddress-go v1.7.0
github.com/sensu/sensu-go/api/core/v2 v2.16.0
github.com/shirou/gopsutil/v3 v3.24.4
github.com/shirou/gopsutil/v4 v4.24.9
github.com/showwin/speedtest-go v1.7.9
github.com/signalfx/golib/v3 v3.3.54
github.com/sijms/go-ora/v2 v2.8.19
Expand Down Expand Up @@ -320,6 +320,7 @@ require (
github.com/eapache/go-resiliency v1.6.0 // indirect
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/ebitengine/purego v0.8.0 // indirect
github.com/echlebek/timeproxy v1.0.0 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down Expand Up @@ -449,6 +450,7 @@ require (
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/samber/lo v1.38.1 // indirect
github.com/seancfoley/bintree v1.3.1 // indirect
github.com/shirou/gopsutil/v3 v3.24.4 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/signalfx/com_signalfx_metrics_protobuf v0.0.3 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 h1:Oy0F4A
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3/go.mod h1:YvSRo5mw33fLEx1+DlK6L2VV43tJt5Eyel9n9XBcR+0=
github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/ebitengine/purego v0.8.0 h1:JbqvnEzRvPpxhCJzJJ2y0RbiZ8nyjccVUrSM3q+GvvE=
github.com/ebitengine/purego v0.8.0/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
github.com/echlebek/crock v1.0.1 h1:KbzamClMIfVIkkjq/GTXf+N16KylYBpiaTitO3f1ujg=
github.com/echlebek/crock v1.0.1/go.mod h1:/kvwHRX3ZXHj/kHWJkjXDmzzRow54EJuHtQ/PapL/HI=
github.com/echlebek/timeproxy v1.0.0 h1:V41/v8tmmMDNMA2GrBPI45nlXb3F7+OY+nJz1BqKsCk=
Expand Down Expand Up @@ -2175,6 +2177,8 @@ github.com/sensu/sensu-go/api/core/v2 v2.16.0/go.mod h1:MjM7+MCGEyTAgaZ589SiGHwY
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil/v3 v3.24.4 h1:dEHgzZXt4LMNm+oYELpzl9YCqV65Yr/6SfrvgRBtXeU=
github.com/shirou/gopsutil/v3 v3.24.4/go.mod h1:lTd2mdiOspcqLgAnr9/nGi71NkeMpWKdmhuxm9GusH8=
github.com/shirou/gopsutil/v4 v4.24.9 h1:KIV+/HaHD5ka5f570RZq+2SaeFsb/pq+fp2DGNWYoOI=
github.com/shirou/gopsutil/v4 v4.24.9/go.mod h1:3fkaHNeYsUFCGZ8+9vZVWtbyM1k2eRnlL+bWO8Bxa/Q=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/conntrack/conntrack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v4/net"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf/plugins/inputs/system"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/cpu/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"time"

"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v4/cpu"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/cpu/cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v4/cpu"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf/plugins/inputs/system"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
"github.com/influxdata/telegraf/plugins/inputs/system"
"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v4/disk"
)

//go:embed sample.conf
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/disk/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"testing"
"time"

"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v4/disk"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v4/disk"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/filter"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/diskio/diskio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v4/disk"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf/plugins/inputs/system"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/intel_powerstat/intel_powerstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"time"

"github.com/intel/powertelemetry"
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v4/cpu"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/config"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/mem/mem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs/system"
"github.com/influxdata/telegraf/testutil"
"github.com/shirou/gopsutil/v3/mem"
"github.com/shirou/gopsutil/v4/mem"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/net/net_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/influxdata/telegraf/metric"
"github.com/influxdata/telegraf/plugins/inputs/system"
"github.com/influxdata/telegraf/testutil"
"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v4/net"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/netstat/netstat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/influxdata/telegraf/metric"
"github.com/influxdata/telegraf/plugins/inputs/system"
"github.com/influxdata/telegraf/testutil"
"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v4/net"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/process"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/filter"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/native_finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/process"
)

// NativeFinder uses gopsutil to find processes
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/procstat/os_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

"github.com/coreos/go-systemd/v22/dbus"
"github.com/prometheus/procfs"
"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/net"
"github.com/shirou/gopsutil/v4/process"
"github.com/vishvananda/netlink"
"golang.org/x/sys/unix"
)
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/procstat/os_others.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"errors"
"syscall"

"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/net"
"github.com/shirou/gopsutil/v4/process"
)

func processName(p *process.Process) (string, error) {
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/procstat/os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"syscall"
"unsafe"

"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/net"
"github.com/shirou/gopsutil/v4/process"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/svc/mgr"
)
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/procstat/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"syscall"
"time"

gopsnet "github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v3/process"
gopsnet "github.com/shirou/gopsutil/v4/net"
"github.com/shirou/gopsutil/v4/process"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/metric"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/procstat.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"strings"
"time"

"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/process"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal/choice"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/procstat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/process"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/procstat/service_finders.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"

"github.com/influxdata/telegraf"
"github.com/shirou/gopsutil/v3/process"
"github.com/shirou/gopsutil/v4/process"
)

type processFinder struct {
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/swap/swap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/influxdata/telegraf/plugins/inputs/system"
"github.com/influxdata/telegraf/testutil"
"github.com/shirou/gopsutil/v3/mem"
"github.com/shirou/gopsutil/v4/mem"
"github.com/stretchr/testify/require"
)

Expand Down
16 changes: 8 additions & 8 deletions plugins/inputs/system/mock_PS.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (

"github.com/stretchr/testify/mock"

"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v4/cpu"
"github.com/shirou/gopsutil/v4/disk"
"github.com/shirou/gopsutil/v4/sensors"

"github.com/shirou/gopsutil/v3/load"
"github.com/shirou/gopsutil/v3/mem"
"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v4/load"
"github.com/shirou/gopsutil/v4/mem"
"github.com/shirou/gopsutil/v4/net"
)

type MockPS struct {
Expand Down Expand Up @@ -101,10 +101,10 @@ func (m *MockPS) SwapStat() (*mem.SwapMemoryStat, error) {
return r0, r1
}

func (m *MockPS) Temperature() ([]host.TemperatureStat, error) {
func (m *MockPS) Temperature() ([]sensors.TemperatureStat, error) {
ret := m.Called()

r0 := ret.Get(0).([]host.TemperatureStat)
r0 := ret.Get(0).([]sensors.TemperatureStat)
r1 := ret.Error(1)

return r0, r1
Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/system/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"path/filepath"
"strings"

"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v3/mem"
"github.com/shirou/gopsutil/v3/net"
"github.com/shirou/gopsutil/v4/cpu"
"github.com/shirou/gopsutil/v4/disk"
"github.com/shirou/gopsutil/v4/mem"
"github.com/shirou/gopsutil/v4/net"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
Expand Down
6 changes: 3 additions & 3 deletions plugins/inputs/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"strings"
"time"

"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v3/load"
"github.com/shirou/gopsutil/v4/cpu"
"github.com/shirou/gopsutil/v4/host"
"github.com/shirou/gopsutil/v4/load"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/system/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package system
import (
"testing"

"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v4/host"
"github.com/stretchr/testify/require"
)

Expand Down
8 changes: 4 additions & 4 deletions plugins/inputs/temp/temp_notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"strings"

"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v4/sensors"

"github.com/influxdata/telegraf"
)
Expand All @@ -26,10 +26,10 @@ func (t *Temperature) Init() error {
}

func (t *Temperature) Gather(acc telegraf.Accumulator) error {
temps, err := host.SensorsTemperatures()
temps, err := sensors.SensorsTemperatures()
if err != nil {
var hostWarnings *host.Warnings
if !errors.As(err, &hostWarnings) {
var sensorsWarnings *sensors.Warnings
if !errors.As(err, &sensorsWarnings) {
if strings.Contains(err.Error(), "not implemented yet") {
return fmt.Errorf("plugin is not supported on this platform: %w", err)
}
Expand Down
Loading

0 comments on commit 67f655b

Please sign in to comment.