github.com/onflow/flow-go@v0.33.17/module/mock/gossip_sub_metrics.go (about) 1 // Code generated by mockery v2.21.4. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 channels "github.com/onflow/flow-go/network/channels" 7 mock "github.com/stretchr/testify/mock" 8 9 p2pmsg "github.com/onflow/flow-go/network/p2p/message" 10 11 time "time" 12 ) 13 14 // GossipSubMetrics is an autogenerated mock type for the GossipSubMetrics type 15 type GossipSubMetrics struct { 16 mock.Mock 17 } 18 19 // AsyncProcessingFinished provides a mock function with given fields: duration 20 func (_m *GossipSubMetrics) AsyncProcessingFinished(duration time.Duration) { 21 _m.Called(duration) 22 } 23 24 // AsyncProcessingStarted provides a mock function with given fields: 25 func (_m *GossipSubMetrics) AsyncProcessingStarted() { 26 _m.Called() 27 } 28 29 // OnActiveClusterIDsNotSetErr provides a mock function with given fields: 30 func (_m *GossipSubMetrics) OnActiveClusterIDsNotSetErr() { 31 _m.Called() 32 } 33 34 // OnAppSpecificScoreUpdated provides a mock function with given fields: _a0 35 func (_m *GossipSubMetrics) OnAppSpecificScoreUpdated(_a0 float64) { 36 _m.Called(_a0) 37 } 38 39 // OnBehaviourPenaltyUpdated provides a mock function with given fields: _a0 40 func (_m *GossipSubMetrics) OnBehaviourPenaltyUpdated(_a0 float64) { 41 _m.Called(_a0) 42 } 43 44 // OnControlMessagesTruncated provides a mock function with given fields: messageType, diff 45 func (_m *GossipSubMetrics) OnControlMessagesTruncated(messageType p2pmsg.ControlMessageType, diff int) { 46 _m.Called(messageType, diff) 47 } 48 49 // OnFirstMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 50 func (_m *GossipSubMetrics) OnFirstMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 51 _m.Called(_a0, _a1) 52 } 53 54 // OnGraftDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 55 func (_m *GossipSubMetrics) OnGraftDuplicateTopicIdsExceedThreshold() { 56 _m.Called() 57 } 58 59 // OnGraftMessageInspected provides a mock function with given fields: duplicateTopicIds 60 func (_m *GossipSubMetrics) OnGraftMessageInspected(duplicateTopicIds int) { 61 _m.Called(duplicateTopicIds) 62 } 63 64 // OnIHaveControlMessageIdsTruncated provides a mock function with given fields: diff 65 func (_m *GossipSubMetrics) OnIHaveControlMessageIdsTruncated(diff int) { 66 _m.Called(diff) 67 } 68 69 // OnIHaveDuplicateMessageIdsExceedThreshold provides a mock function with given fields: 70 func (_m *GossipSubMetrics) OnIHaveDuplicateMessageIdsExceedThreshold() { 71 _m.Called() 72 } 73 74 // OnIHaveDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 75 func (_m *GossipSubMetrics) OnIHaveDuplicateTopicIdsExceedThreshold() { 76 _m.Called() 77 } 78 79 // OnIHaveMessageIDsReceived provides a mock function with given fields: channel, msgIdCount 80 func (_m *GossipSubMetrics) OnIHaveMessageIDsReceived(channel string, msgIdCount int) { 81 _m.Called(channel, msgIdCount) 82 } 83 84 // OnIHaveMessagesInspected provides a mock function with given fields: duplicateTopicIds, duplicateMessageIds 85 func (_m *GossipSubMetrics) OnIHaveMessagesInspected(duplicateTopicIds int, duplicateMessageIds int) { 86 _m.Called(duplicateTopicIds, duplicateMessageIds) 87 } 88 89 // OnIPColocationFactorUpdated provides a mock function with given fields: _a0 90 func (_m *GossipSubMetrics) OnIPColocationFactorUpdated(_a0 float64) { 91 _m.Called(_a0) 92 } 93 94 // OnIWantCacheMissMessageIdsExceedThreshold provides a mock function with given fields: 95 func (_m *GossipSubMetrics) OnIWantCacheMissMessageIdsExceedThreshold() { 96 _m.Called() 97 } 98 99 // OnIWantControlMessageIdsTruncated provides a mock function with given fields: diff 100 func (_m *GossipSubMetrics) OnIWantControlMessageIdsTruncated(diff int) { 101 _m.Called(diff) 102 } 103 104 // OnIWantDuplicateMessageIdsExceedThreshold provides a mock function with given fields: 105 func (_m *GossipSubMetrics) OnIWantDuplicateMessageIdsExceedThreshold() { 106 _m.Called() 107 } 108 109 // OnIWantMessageIDsReceived provides a mock function with given fields: msgIdCount 110 func (_m *GossipSubMetrics) OnIWantMessageIDsReceived(msgIdCount int) { 111 _m.Called(msgIdCount) 112 } 113 114 // OnIWantMessagesInspected provides a mock function with given fields: duplicateCount, cacheMissCount 115 func (_m *GossipSubMetrics) OnIWantMessagesInspected(duplicateCount int, cacheMissCount int) { 116 _m.Called(duplicateCount, cacheMissCount) 117 } 118 119 // OnIncomingRpcReceived provides a mock function with given fields: iHaveCount, iWantCount, graftCount, pruneCount, msgCount 120 func (_m *GossipSubMetrics) OnIncomingRpcReceived(iHaveCount int, iWantCount int, graftCount int, pruneCount int, msgCount int) { 121 _m.Called(iHaveCount, iWantCount, graftCount, pruneCount, msgCount) 122 } 123 124 // OnInvalidControlMessageNotificationSent provides a mock function with given fields: 125 func (_m *GossipSubMetrics) OnInvalidControlMessageNotificationSent() { 126 _m.Called() 127 } 128 129 // OnInvalidMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 130 func (_m *GossipSubMetrics) OnInvalidMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 131 _m.Called(_a0, _a1) 132 } 133 134 // OnInvalidTopicIdDetectedForControlMessage provides a mock function with given fields: messageType 135 func (_m *GossipSubMetrics) OnInvalidTopicIdDetectedForControlMessage(messageType p2pmsg.ControlMessageType) { 136 _m.Called(messageType) 137 } 138 139 // OnLocalMeshSizeUpdated provides a mock function with given fields: topic, size 140 func (_m *GossipSubMetrics) OnLocalMeshSizeUpdated(topic string, size int) { 141 _m.Called(topic, size) 142 } 143 144 // OnLocalPeerJoinedTopic provides a mock function with given fields: 145 func (_m *GossipSubMetrics) OnLocalPeerJoinedTopic() { 146 _m.Called() 147 } 148 149 // OnLocalPeerLeftTopic provides a mock function with given fields: 150 func (_m *GossipSubMetrics) OnLocalPeerLeftTopic() { 151 _m.Called() 152 } 153 154 // OnMeshMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 155 func (_m *GossipSubMetrics) OnMeshMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 156 _m.Called(_a0, _a1) 157 } 158 159 // OnMessageDeliveredToAllSubscribers provides a mock function with given fields: size 160 func (_m *GossipSubMetrics) OnMessageDeliveredToAllSubscribers(size int) { 161 _m.Called(size) 162 } 163 164 // OnMessageDuplicate provides a mock function with given fields: size 165 func (_m *GossipSubMetrics) OnMessageDuplicate(size int) { 166 _m.Called(size) 167 } 168 169 // OnMessageEnteredValidation provides a mock function with given fields: size 170 func (_m *GossipSubMetrics) OnMessageEnteredValidation(size int) { 171 _m.Called(size) 172 } 173 174 // OnMessageRejected provides a mock function with given fields: size, reason 175 func (_m *GossipSubMetrics) OnMessageRejected(size int, reason string) { 176 _m.Called(size, reason) 177 } 178 179 // OnOutboundRpcDropped provides a mock function with given fields: 180 func (_m *GossipSubMetrics) OnOutboundRpcDropped() { 181 _m.Called() 182 } 183 184 // OnOverallPeerScoreUpdated provides a mock function with given fields: _a0 185 func (_m *GossipSubMetrics) OnOverallPeerScoreUpdated(_a0 float64) { 186 _m.Called(_a0) 187 } 188 189 // OnPeerAddedToProtocol provides a mock function with given fields: protocol 190 func (_m *GossipSubMetrics) OnPeerAddedToProtocol(protocol string) { 191 _m.Called(protocol) 192 } 193 194 // OnPeerGraftTopic provides a mock function with given fields: topic 195 func (_m *GossipSubMetrics) OnPeerGraftTopic(topic string) { 196 _m.Called(topic) 197 } 198 199 // OnPeerPruneTopic provides a mock function with given fields: topic 200 func (_m *GossipSubMetrics) OnPeerPruneTopic(topic string) { 201 _m.Called(topic) 202 } 203 204 // OnPeerRemovedFromProtocol provides a mock function with given fields: 205 func (_m *GossipSubMetrics) OnPeerRemovedFromProtocol() { 206 _m.Called() 207 } 208 209 // OnPeerThrottled provides a mock function with given fields: 210 func (_m *GossipSubMetrics) OnPeerThrottled() { 211 _m.Called() 212 } 213 214 // OnPruneDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 215 func (_m *GossipSubMetrics) OnPruneDuplicateTopicIdsExceedThreshold() { 216 _m.Called() 217 } 218 219 // OnPruneMessageInspected provides a mock function with given fields: duplicateTopicIds 220 func (_m *GossipSubMetrics) OnPruneMessageInspected(duplicateTopicIds int) { 221 _m.Called(duplicateTopicIds) 222 } 223 224 // OnPublishMessageInspected provides a mock function with given fields: totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount 225 func (_m *GossipSubMetrics) OnPublishMessageInspected(totalErrCount int, invalidTopicIdsCount int, invalidSubscriptionsCount int, invalidSendersCount int) { 226 _m.Called(totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount) 227 } 228 229 // OnPublishMessagesInspectionErrorExceedsThreshold provides a mock function with given fields: 230 func (_m *GossipSubMetrics) OnPublishMessagesInspectionErrorExceedsThreshold() { 231 _m.Called() 232 } 233 234 // OnRpcReceived provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount 235 func (_m *GossipSubMetrics) OnRpcReceived(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) { 236 _m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount) 237 } 238 239 // OnRpcSent provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount 240 func (_m *GossipSubMetrics) OnRpcSent(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) { 241 _m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount) 242 } 243 244 // OnTimeInMeshUpdated provides a mock function with given fields: _a0, _a1 245 func (_m *GossipSubMetrics) OnTimeInMeshUpdated(_a0 channels.Topic, _a1 time.Duration) { 246 _m.Called(_a0, _a1) 247 } 248 249 // OnUndeliveredMessage provides a mock function with given fields: 250 func (_m *GossipSubMetrics) OnUndeliveredMessage() { 251 _m.Called() 252 } 253 254 // OnUnstakedPeerInspectionFailed provides a mock function with given fields: 255 func (_m *GossipSubMetrics) OnUnstakedPeerInspectionFailed() { 256 _m.Called() 257 } 258 259 // SetWarningStateCount provides a mock function with given fields: _a0 260 func (_m *GossipSubMetrics) SetWarningStateCount(_a0 uint) { 261 _m.Called(_a0) 262 } 263 264 type mockConstructorTestingTNewGossipSubMetrics interface { 265 mock.TestingT 266 Cleanup(func()) 267 } 268 269 // 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. 270 func NewGossipSubMetrics(t mockConstructorTestingTNewGossipSubMetrics) *GossipSubMetrics { 271 mock := &GossipSubMetrics{} 272 mock.Mock.Test(t) 273 274 t.Cleanup(func() { mock.AssertExpectations(t) }) 275 276 return mock 277 }