Skip to content

Commit

Permalink
fixing issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramadon committed Sep 27, 2024
1 parent d70182c commit 04db0b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
16 changes: 0 additions & 16 deletions plugins/inputs/procstat/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import (
"fmt"
"time"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/metric"
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/process"
)
Expand Down Expand Up @@ -78,17 +76,3 @@ func (p *Proc) Percent(_ time.Duration) (float64, error) {
}
return cpuPerc, err
}

func (p *Proc) Metric(prefix string, cfg *collectionConfig) telegraf.Metric {
if prefix != "" {
prefix += "_"
}

fields := make(map[string]interface{})

if cfg.features["mmap"] {
collectMemmap(p, prefix, fields)
}

return metric.New("procstat", p.tags, fields, time.Time{})
}
6 changes: 1 addition & 5 deletions plugins/inputs/procstat/procstat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import (
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/process"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf"

"github.com/influxdata/telegraf/testutil"
)

Expand Down Expand Up @@ -136,9 +135,6 @@ func (p *testProc) MemoryInfo() (*process.MemoryInfoStat, error) {
func (p *testProc) MemoryMaps(bool) (*[]process.MemoryMapsStat, error) {
return &[]process.MemoryMapsStat{}, nil
}
func (p *testProc) Metric(prefix string, cfg *collectionConfig) telegraf.Metric {
return nil
}
func (p *testProc) Name() (string, error) {
return "test_proc", nil
}
Expand Down

0 comments on commit 04db0b0

Please sign in to comment.