Simplify system.DiskUsage() (#2630)

This commit is contained in:
Nikolay Denev
2017-04-18 19:42:58 +01:00
committed by Daniel Nelson
parent 70b3e763e7
commit eb7ef5392e
8 changed files with 212 additions and 28 deletions

View File

@@ -73,11 +73,12 @@ func (s *SwapStats) Gather(acc telegraf.Accumulator) error {
}
func init() {
ps := newSystemPS()
inputs.Add("mem", func() telegraf.Input {
return &MemStats{ps: &systemPS{}}
return &MemStats{ps: ps}
})
inputs.Add("swap", func() telegraf.Input {
return &SwapStats{ps: &systemPS{}}
return &SwapStats{ps: ps}
})
}