Change duration -> internal and implement private gopsutil methods
This commit is contained in:
@@ -13,8 +13,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdb/telegraf/internal"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
common "github.com/shirou/gopsutil/common"
|
||||
)
|
||||
|
||||
// Lustre proc files can change between versions, so we want to future-proof
|
||||
@@ -144,7 +144,7 @@ func (l *Lustre2) GetLustreProcStats(fileglob string, wanted_fields []*mapping,
|
||||
"name": name,
|
||||
}
|
||||
|
||||
lines, err := common.ReadLines(file)
|
||||
lines, err := internal.ReadLines(file)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
dc "github.com/fsouza/go-dockerclient"
|
||||
"github.com/influxdb/telegraf/internal"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
"github.com/shirou/gopsutil/common"
|
||||
|
||||
dc "github.com/fsouza/go-dockerclient"
|
||||
"github.com/shirou/gopsutil/cpu"
|
||||
"github.com/shirou/gopsutil/disk"
|
||||
"github.com/shirou/gopsutil/docker"
|
||||
@@ -97,7 +98,7 @@ func (s *systemPS) NetConnections() ([]net.NetConnectionStat, error) {
|
||||
|
||||
func (s *systemPS) DiskIO() (map[string]disk.DiskIOCountersStat, error) {
|
||||
m, err := disk.DiskIOCounters()
|
||||
if err == common.NotImplementedError {
|
||||
if err == internal.NotImplementedError {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/influxdb/telegraf/internal"
|
||||
"github.com/influxdb/telegraf/plugins"
|
||||
"github.com/shirou/gopsutil/common"
|
||||
)
|
||||
|
||||
type Zfs struct {
|
||||
@@ -60,7 +60,7 @@ func (z *Zfs) Gather(acc plugins.Accumulator) error {
|
||||
tags := getTags(kstatPath)
|
||||
|
||||
for _, metric := range kstatMetrics {
|
||||
lines, err := common.ReadLines(kstatPath + "/" + metric)
|
||||
lines, err := internal.ReadLines(kstatPath + "/" + metric)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user