add tcp connections stat plugin.

This commit is contained in:
Shirou WAKAYAMA
2015-10-05 22:49:01 +09:00
committed by Cameron Sparr
parent 1d1180ec0c
commit dc38e448bd
2 changed files with 65 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ type PS interface {
VMStat() (*mem.VirtualMemoryStat, error)
SwapStat() (*mem.SwapMemoryStat, error)
DockerStat() ([]*DockerContainerStat, error)
NetConnections() ([]net.NetConnectionStat, error)
}
func add(acc plugins.Accumulator,
@@ -90,6 +91,10 @@ func (s *systemPS) NetIO() ([]net.NetIOCountersStat, error) {
return net.NetIOCounters(true)
}
func (s *systemPS) NetConnections() ([]net.NetConnectionStat, error) {
return net.NetConnections("all")
}
func (s *systemPS) DiskIO() (map[string]disk.DiskIOCountersStat, error) {
m, err := disk.DiskIOCounters()
if err == common.NotImplementedError {