-
Notifications
You must be signed in to change notification settings - Fork 175
/
gossip_sub_metrics.go
297 lines (235 loc) · 10.8 KB
/
gossip_sub_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
// 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"
p2pmsg "github.com/onflow/flow-go/network/p2p/message"
time "time"
)
// GossipSubMetrics is an autogenerated mock type for the GossipSubMetrics type
type GossipSubMetrics struct {
mock.Mock
}
// AsyncProcessingFinished provides a mock function with given fields: duration
func (_m *GossipSubMetrics) AsyncProcessingFinished(duration time.Duration) {
_m.Called(duration)
}
// AsyncProcessingStarted provides a mock function with given fields:
func (_m *GossipSubMetrics) AsyncProcessingStarted() {
_m.Called()
}
// OnActiveClusterIDsNotSetErr provides a mock function with given fields:
func (_m *GossipSubMetrics) OnActiveClusterIDsNotSetErr() {
_m.Called()
}
// OnAppSpecificScoreUpdated provides a mock function with given fields: _a0
func (_m *GossipSubMetrics) OnAppSpecificScoreUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnBehaviourPenaltyUpdated provides a mock function with given fields: _a0
func (_m *GossipSubMetrics) OnBehaviourPenaltyUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnControlMessagesTruncated provides a mock function with given fields: messageType, diff
func (_m *GossipSubMetrics) OnControlMessagesTruncated(messageType p2pmsg.ControlMessageType, diff int) {
_m.Called(messageType, diff)
}
// OnFirstMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *GossipSubMetrics) OnFirstMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnGraftDuplicateTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnGraftDuplicateTopicIdsExceedThreshold() {
_m.Called()
}
// OnGraftInvalidTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnGraftInvalidTopicIdsExceedThreshold() {
_m.Called()
}
// OnGraftMessageInspected provides a mock function with given fields: duplicateTopicIds, invalidTopicIds
func (_m *GossipSubMetrics) OnGraftMessageInspected(duplicateTopicIds int, invalidTopicIds int) {
_m.Called(duplicateTopicIds, invalidTopicIds)
}
// OnIHaveControlMessageIdsTruncated provides a mock function with given fields: diff
func (_m *GossipSubMetrics) OnIHaveControlMessageIdsTruncated(diff int) {
_m.Called(diff)
}
// OnIHaveDuplicateMessageIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnIHaveDuplicateMessageIdsExceedThreshold() {
_m.Called()
}
// OnIHaveDuplicateTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnIHaveDuplicateTopicIdsExceedThreshold() {
_m.Called()
}
// OnIHaveInvalidTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnIHaveInvalidTopicIdsExceedThreshold() {
_m.Called()
}
// OnIHaveMessageIDsReceived provides a mock function with given fields: channel, msgIdCount
func (_m *GossipSubMetrics) OnIHaveMessageIDsReceived(channel string, msgIdCount int) {
_m.Called(channel, msgIdCount)
}
// OnIHaveMessagesInspected provides a mock function with given fields: duplicateTopicIds, duplicateMessageIds, invalidTopicIds
func (_m *GossipSubMetrics) OnIHaveMessagesInspected(duplicateTopicIds int, duplicateMessageIds int, invalidTopicIds int) {
_m.Called(duplicateTopicIds, duplicateMessageIds, invalidTopicIds)
}
// OnIPColocationFactorUpdated provides a mock function with given fields: _a0
func (_m *GossipSubMetrics) OnIPColocationFactorUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnIWantCacheMissMessageIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnIWantCacheMissMessageIdsExceedThreshold() {
_m.Called()
}
// OnIWantControlMessageIdsTruncated provides a mock function with given fields: diff
func (_m *GossipSubMetrics) OnIWantControlMessageIdsTruncated(diff int) {
_m.Called(diff)
}
// OnIWantDuplicateMessageIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnIWantDuplicateMessageIdsExceedThreshold() {
_m.Called()
}
// OnIWantMessageIDsReceived provides a mock function with given fields: msgIdCount
func (_m *GossipSubMetrics) OnIWantMessageIDsReceived(msgIdCount int) {
_m.Called(msgIdCount)
}
// OnIWantMessagesInspected provides a mock function with given fields: duplicateCount, cacheMissCount
func (_m *GossipSubMetrics) OnIWantMessagesInspected(duplicateCount int, cacheMissCount int) {
_m.Called(duplicateCount, cacheMissCount)
}
// OnIncomingRpcReceived provides a mock function with given fields: iHaveCount, iWantCount, graftCount, pruneCount, msgCount
func (_m *GossipSubMetrics) OnIncomingRpcReceived(iHaveCount int, iWantCount int, graftCount int, pruneCount int, msgCount int) {
_m.Called(iHaveCount, iWantCount, graftCount, pruneCount, msgCount)
}
// OnInvalidControlMessageNotificationSent provides a mock function with given fields:
func (_m *GossipSubMetrics) OnInvalidControlMessageNotificationSent() {
_m.Called()
}
// OnInvalidMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *GossipSubMetrics) OnInvalidMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnInvalidTopicIdDetectedForControlMessage provides a mock function with given fields: messageType
func (_m *GossipSubMetrics) OnInvalidTopicIdDetectedForControlMessage(messageType p2pmsg.ControlMessageType) {
_m.Called(messageType)
}
// OnLocalMeshSizeUpdated provides a mock function with given fields: topic, size
func (_m *GossipSubMetrics) OnLocalMeshSizeUpdated(topic string, size int) {
_m.Called(topic, size)
}
// OnLocalPeerJoinedTopic provides a mock function with given fields:
func (_m *GossipSubMetrics) OnLocalPeerJoinedTopic() {
_m.Called()
}
// OnLocalPeerLeftTopic provides a mock function with given fields:
func (_m *GossipSubMetrics) OnLocalPeerLeftTopic() {
_m.Called()
}
// OnMeshMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1
func (_m *GossipSubMetrics) OnMeshMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) {
_m.Called(_a0, _a1)
}
// OnMessageDeliveredToAllSubscribers provides a mock function with given fields: size
func (_m *GossipSubMetrics) OnMessageDeliveredToAllSubscribers(size int) {
_m.Called(size)
}
// OnMessageDuplicate provides a mock function with given fields: size
func (_m *GossipSubMetrics) OnMessageDuplicate(size int) {
_m.Called(size)
}
// OnMessageEnteredValidation provides a mock function with given fields: size
func (_m *GossipSubMetrics) OnMessageEnteredValidation(size int) {
_m.Called(size)
}
// OnMessageRejected provides a mock function with given fields: size, reason
func (_m *GossipSubMetrics) OnMessageRejected(size int, reason string) {
_m.Called(size, reason)
}
// OnOutboundRpcDropped provides a mock function with given fields:
func (_m *GossipSubMetrics) OnOutboundRpcDropped() {
_m.Called()
}
// OnOverallPeerScoreUpdated provides a mock function with given fields: _a0
func (_m *GossipSubMetrics) OnOverallPeerScoreUpdated(_a0 float64) {
_m.Called(_a0)
}
// OnPeerAddedToProtocol provides a mock function with given fields: protocol
func (_m *GossipSubMetrics) OnPeerAddedToProtocol(protocol string) {
_m.Called(protocol)
}
// OnPeerGraftTopic provides a mock function with given fields: topic
func (_m *GossipSubMetrics) OnPeerGraftTopic(topic string) {
_m.Called(topic)
}
// OnPeerPruneTopic provides a mock function with given fields: topic
func (_m *GossipSubMetrics) OnPeerPruneTopic(topic string) {
_m.Called(topic)
}
// OnPeerRemovedFromProtocol provides a mock function with given fields:
func (_m *GossipSubMetrics) OnPeerRemovedFromProtocol() {
_m.Called()
}
// OnPeerThrottled provides a mock function with given fields:
func (_m *GossipSubMetrics) OnPeerThrottled() {
_m.Called()
}
// OnPruneDuplicateTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnPruneDuplicateTopicIdsExceedThreshold() {
_m.Called()
}
// OnPruneInvalidTopicIdsExceedThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnPruneInvalidTopicIdsExceedThreshold() {
_m.Called()
}
// OnPruneMessageInspected provides a mock function with given fields: duplicateTopicIds, invalidTopicIds
func (_m *GossipSubMetrics) OnPruneMessageInspected(duplicateTopicIds int, invalidTopicIds int) {
_m.Called(duplicateTopicIds, invalidTopicIds)
}
// OnPublishMessageInspected provides a mock function with given fields: totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount
func (_m *GossipSubMetrics) OnPublishMessageInspected(totalErrCount int, invalidTopicIdsCount int, invalidSubscriptionsCount int, invalidSendersCount int) {
_m.Called(totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount)
}
// OnPublishMessagesInspectionErrorExceedsThreshold provides a mock function with given fields:
func (_m *GossipSubMetrics) OnPublishMessagesInspectionErrorExceedsThreshold() {
_m.Called()
}
// OnRpcReceived provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount
func (_m *GossipSubMetrics) OnRpcReceived(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) {
_m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount)
}
// OnRpcRejectedFromUnknownSender provides a mock function with given fields:
func (_m *GossipSubMetrics) OnRpcRejectedFromUnknownSender() {
_m.Called()
}
// OnRpcSent provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount
func (_m *GossipSubMetrics) OnRpcSent(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) {
_m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount)
}
// OnTimeInMeshUpdated provides a mock function with given fields: _a0, _a1
func (_m *GossipSubMetrics) OnTimeInMeshUpdated(_a0 channels.Topic, _a1 time.Duration) {
_m.Called(_a0, _a1)
}
// OnUndeliveredMessage provides a mock function with given fields:
func (_m *GossipSubMetrics) OnUndeliveredMessage() {
_m.Called()
}
// OnUnstakedPeerInspectionFailed provides a mock function with given fields:
func (_m *GossipSubMetrics) OnUnstakedPeerInspectionFailed() {
_m.Called()
}
// SetWarningStateCount provides a mock function with given fields: _a0
func (_m *GossipSubMetrics) SetWarningStateCount(_a0 uint) {
_m.Called(_a0)
}
type mockConstructorTestingTNewGossipSubMetrics interface {
mock.TestingT
Cleanup(func())
}
// NewGossipSubMetrics creates a new instance of GossipSubMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewGossipSubMetrics(t mockConstructorTestingTNewGossipSubMetrics) *GossipSubMetrics {
mock := &GossipSubMetrics{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}