forked from influxdata/telegraf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mock_PS.go
98 lines (67 loc) · 1.83 KB
/
mock_PS.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package system
import (
"github.com/stretchr/testify/mock"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/load"
"github.com/shirou/gopsutil/mem"
"github.com/shirou/gopsutil/net"
)
type MockPS struct {
mock.Mock
}
func (m *MockPS) LoadAvg() (*load.AvgStat, error) {
ret := m.Called()
r0 := ret.Get(0).(*load.AvgStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) CPUTimes(perCPU, totalCPU bool) ([]cpu.TimesStat, error) {
ret := m.Called()
r0 := ret.Get(0).([]cpu.TimesStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) DiskUsage(mountPointFilter []string, fstypeExclude []string) ([]*disk.UsageStat, []*disk.PartitionStat, error) {
ret := m.Called(mountPointFilter, fstypeExclude)
r0 := ret.Get(0).([]*disk.UsageStat)
r1 := ret.Get(1).([]*disk.PartitionStat)
r2 := ret.Error(2)
return r0, r1, r2
}
func (m *MockPS) NetIO() ([]net.IOCountersStat, error) {
ret := m.Called()
r0 := ret.Get(0).([]net.IOCountersStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) NetProto() ([]net.ProtoCountersStat, error) {
ret := m.Called()
r0 := ret.Get(0).([]net.ProtoCountersStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) DiskIO() (map[string]disk.IOCountersStat, error) {
ret := m.Called()
r0 := ret.Get(0).(map[string]disk.IOCountersStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) VMStat() (*mem.VirtualMemoryStat, error) {
ret := m.Called()
r0 := ret.Get(0).(*mem.VirtualMemoryStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) SwapStat() (*mem.SwapMemoryStat, error) {
ret := m.Called()
r0 := ret.Get(0).(*mem.SwapMemoryStat)
r1 := ret.Error(1)
return r0, r1
}
func (m *MockPS) NetConnections() ([]net.ConnectionStat, error) {
ret := m.Called()
r0 := ret.Get(0).([]net.ConnectionStat)
r1 := ret.Error(1)
return r0, r1
}