-
Notifications
You must be signed in to change notification settings - Fork 175
/
lib_p2_p_metrics.go
301 lines (237 loc) · 9.31 KB
/
lib_p2_p_metrics.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
// Code generated by mockery v2.21.4. DO NOT EDIT.
package mock
import (
channels "github.com/onflow/flow-go/network/channels"
mock "github.com/stretchr/testify/mock"
network "github.com/libp2p/go-libp2p/core/network"
peer "github.com/libp2p/go-libp2p/core/peer"
protocol "github.com/libp2p/go-libp2p/core/protocol"
time "time"
)
// LibP2PMetrics is an autogenerated mock type for the LibP2PMetrics type
type LibP2PMetrics struct {
mock.Mock
}
// AllowConn provides a mock function with given fields: dir, usefd
func (_m *LibP2PMetrics) AllowConn(dir network.Direction, usefd bool) {
_m.Called(dir, usefd)
}
// AllowMemory provides a mock function with given fields: size
func (_m *LibP2PMetrics) AllowMemory(size int) {
_m.Called(size)
}
// AllowPeer provides a mock function with given fields: p
func (_m *LibP2PMetrics) AllowPeer(p peer.ID) {
_m.Called(p)
}
// AllowProtocol provides a mock function with given fields: proto
func (_m *LibP2PMetrics) AllowProtocol(proto protocol.ID) {
_m.Called(proto)
}
// AllowService provides a mock function with given fields: svc
func (_m *LibP2PMetrics) AllowService(svc string) {
_m.Called(svc)
}
// AllowStream provides a mock function with given fields: p, dir
func (_m *LibP2PMetrics) AllowStream(p peer.ID, dir network.Direction) {
_m.Called(p, dir)
}
// AsyncProcessingFinished provides a mock function with given fields: duration
func (_m *LibP2PMetrics) AsyncProcessingFinished(duration time.Duration) {
_m.Called(duration)
}
// AsyncProcessingStarted provides a mock function with given fields:
func (_m *LibP2PMetrics) AsyncProcessingStarted() {
_m.Called()
}
// BlockConn provides a mock function with given fields: dir, usefd
func (_m *LibP2PMetrics) BlockConn(dir network.Direction, usefd bool) {
_m.Called(dir, usefd)
}
// BlockMemory provides a mock function with given fields: size
func (_m *LibP2PMetrics) BlockMemory(size int) {
_m.Called(size)
}
// BlockPeer provides a mock function with given fields: p
func (_m *LibP2PMetrics) BlockPeer(p peer.ID) {
_m.Called(p)
}
// BlockProtocol provides a mock function with given fields: proto
func (_m *LibP2PMetrics) BlockProtocol(proto protocol.ID) {
_m.Called(proto)
}
// BlockProtocolPeer provides a mock function with given fields: proto, p
func (_m *LibP2PMetrics) BlockProtocolPeer(proto protocol.ID, p peer.ID) {
_m.Called(proto, p)
}
// BlockService provides a mock function with given fields: svc
func (_m *LibP2PMetrics) BlockService(svc string) {
_m.Called(svc)
}
// BlockServicePeer provides a mock function with given fields: svc, p
func (_m *LibP2PMetrics) BlockServicePeer(svc string, p peer.ID) {
_m.Called(svc, p)
}
// BlockStream provides a mock function with given fields: p, dir
func (_m *LibP2PMetrics) BlockStream(p peer.ID, dir network.Direction) {
_m.Called(p, dir)
}
// DNSLookupDuration provides a mock function with given fields: duration
func (_m *LibP2PMetrics) DNSLookupDuration(duration time.Duration) {
_m.Called(duration)
}
// InboundConnections provides a mock function with given fields: connectionCount
func (_m *LibP2PMetrics) InboundConnections(connectionCount uint) {
_m.Called(connectionCount)
}
// OnAppSpecificScoreUpdated provides a mock function with given fields: _a0
func (_m *LibP2PMetrics) OnAppSpecificScoreUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnBehaviourPenaltyUpdated provides a mock function with given fields: _a0
func (_m *LibP2PMetrics) OnBehaviourPenaltyUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnDNSCacheHit provides a mock function with given fields:
func (_m *LibP2PMetrics) OnDNSCacheHit() {
_m.Called()
}
// OnDNSCacheInvalidated provides a mock function with given fields:
func (_m *LibP2PMetrics) OnDNSCacheInvalidated() {
_m.Called()
}
// OnDNSCacheMiss provides a mock function with given fields:
func (_m *LibP2PMetrics) OnDNSCacheMiss() {
_m.Called()
}
// OnDNSLookupRequestDropped provides a mock function with given fields:
func (_m *LibP2PMetrics) OnDNSLookupRequestDropped() {
_m.Called()
}
// OnDialRetryBudgetResetToDefault provides a mock function with given fields:
func (_m *LibP2PMetrics) OnDialRetryBudgetResetToDefault() {
_m.Called()
}
// OnDialRetryBudgetUpdated provides a mock function with given fields: budget
func (_m *LibP2PMetrics) OnDialRetryBudgetUpdated(budget uint64) {
_m.Called(budget)
}
// OnEstablishStreamFailure provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnEstablishStreamFailure(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnFirstMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *LibP2PMetrics) OnFirstMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnGraftReceived provides a mock function with given fields: count
func (_m *LibP2PMetrics) OnGraftReceived(count int) {
_m.Called(count)
}
// OnIHaveReceived provides a mock function with given fields: count
func (_m *LibP2PMetrics) OnIHaveReceived(count int) {
_m.Called(count)
}
// OnIPColocationFactorUpdated provides a mock function with given fields: _a0
func (_m *LibP2PMetrics) OnIPColocationFactorUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnIWantReceived provides a mock function with given fields: count
func (_m *LibP2PMetrics) OnIWantReceived(count int) {
_m.Called(count)
}
// OnIncomingRpcAcceptedFully provides a mock function with given fields:
func (_m *LibP2PMetrics) OnIncomingRpcAcceptedFully() {
_m.Called()
}
// OnIncomingRpcAcceptedOnlyForControlMessages provides a mock function with given fields:
func (_m *LibP2PMetrics) OnIncomingRpcAcceptedOnlyForControlMessages() {
_m.Called()
}
// OnIncomingRpcRejected provides a mock function with given fields:
func (_m *LibP2PMetrics) OnIncomingRpcRejected() {
_m.Called()
}
// OnInvalidMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *LibP2PMetrics) OnInvalidMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnLocalMeshSizeUpdated provides a mock function with given fields: topic, size
func (_m *LibP2PMetrics) OnLocalMeshSizeUpdated(topic string, size int) {
_m.Called(topic, size)
}
// OnMeshMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *LibP2PMetrics) OnMeshMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnOverallPeerScoreUpdated provides a mock function with given fields: _a0
func (_m *LibP2PMetrics) OnOverallPeerScoreUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnPeerDialFailure provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnPeerDialFailure(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnPeerDialed provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnPeerDialed(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnPruneReceived provides a mock function with given fields: count
func (_m *LibP2PMetrics) OnPruneReceived(count int) {
_m.Called(count)
}
// OnPublishedGossipMessagesReceived provides a mock function with given fields: count
func (_m *LibP2PMetrics) OnPublishedGossipMessagesReceived(count int) {
_m.Called(count)
}
// OnStreamCreated provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnStreamCreated(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnStreamCreationFailure provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnStreamCreationFailure(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnStreamCreationRetryBudgetResetToDefault provides a mock function with given fields:
func (_m *LibP2PMetrics) OnStreamCreationRetryBudgetResetToDefault() {
_m.Called()
}
// OnStreamCreationRetryBudgetUpdated provides a mock function with given fields: budget
func (_m *LibP2PMetrics) OnStreamCreationRetryBudgetUpdated(budget uint64) {
_m.Called(budget)
}
// OnStreamEstablished provides a mock function with given fields: duration, attempts
func (_m *LibP2PMetrics) OnStreamEstablished(duration time.Duration, attempts int) {
_m.Called(duration, attempts)
}
// OnTimeInMeshUpdated provides a mock function with given fields: _a0, _a1
func (_m *LibP2PMetrics) OnTimeInMeshUpdated(_a0 channels.Topic, _a1 time.Duration) {
_m.Called(_a0, _a1)
}
// OutboundConnections provides a mock function with given fields: connectionCount
func (_m *LibP2PMetrics) OutboundConnections(connectionCount uint) {
_m.Called(connectionCount)
}
// RoutingTablePeerAdded provides a mock function with given fields:
func (_m *LibP2PMetrics) RoutingTablePeerAdded() {
_m.Called()
}
// RoutingTablePeerRemoved provides a mock function with given fields:
func (_m *LibP2PMetrics) RoutingTablePeerRemoved() {
_m.Called()
}
// SetWarningStateCount provides a mock function with given fields: _a0
func (_m *LibP2PMetrics) SetWarningStateCount(_a0 uint) {
_m.Called(_a0)
}
type mockConstructorTestingTNewLibP2PMetrics interface {
mock.TestingT
Cleanup(func())
}
// NewLibP2PMetrics creates a new instance of LibP2PMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewLibP2PMetrics(t mockConstructorTestingTNewLibP2PMetrics) *LibP2PMetrics {
mock := &LibP2PMetrics{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}