github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/mock/lib_p2_p_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 network "github.com/libp2p/go-libp2p/core/network" 10 11 p2pmsg "github.com/onflow/flow-go/network/p2p/message" 12 13 peer "github.com/libp2p/go-libp2p/core/peer" 14 15 protocol "github.com/libp2p/go-libp2p/core/protocol" 16 17 time "time" 18 ) 19 20 // LibP2PMetrics is an autogenerated mock type for the LibP2PMetrics type 21 type LibP2PMetrics struct { 22 mock.Mock 23 } 24 25 // AllowConn provides a mock function with given fields: dir, usefd 26 func (_m *LibP2PMetrics) AllowConn(dir network.Direction, usefd bool) { 27 _m.Called(dir, usefd) 28 } 29 30 // AllowMemory provides a mock function with given fields: size 31 func (_m *LibP2PMetrics) AllowMemory(size int) { 32 _m.Called(size) 33 } 34 35 // AllowPeer provides a mock function with given fields: p 36 func (_m *LibP2PMetrics) AllowPeer(p peer.ID) { 37 _m.Called(p) 38 } 39 40 // AllowProtocol provides a mock function with given fields: proto 41 func (_m *LibP2PMetrics) AllowProtocol(proto protocol.ID) { 42 _m.Called(proto) 43 } 44 45 // AllowService provides a mock function with given fields: svc 46 func (_m *LibP2PMetrics) AllowService(svc string) { 47 _m.Called(svc) 48 } 49 50 // AllowStream provides a mock function with given fields: p, dir 51 func (_m *LibP2PMetrics) AllowStream(p peer.ID, dir network.Direction) { 52 _m.Called(p, dir) 53 } 54 55 // AsyncProcessingFinished provides a mock function with given fields: duration 56 func (_m *LibP2PMetrics) AsyncProcessingFinished(duration time.Duration) { 57 _m.Called(duration) 58 } 59 60 // AsyncProcessingStarted provides a mock function with given fields: 61 func (_m *LibP2PMetrics) AsyncProcessingStarted() { 62 _m.Called() 63 } 64 65 // BlockConn provides a mock function with given fields: dir, usefd 66 func (_m *LibP2PMetrics) BlockConn(dir network.Direction, usefd bool) { 67 _m.Called(dir, usefd) 68 } 69 70 // BlockMemory provides a mock function with given fields: size 71 func (_m *LibP2PMetrics) BlockMemory(size int) { 72 _m.Called(size) 73 } 74 75 // BlockPeer provides a mock function with given fields: p 76 func (_m *LibP2PMetrics) BlockPeer(p peer.ID) { 77 _m.Called(p) 78 } 79 80 // BlockProtocol provides a mock function with given fields: proto 81 func (_m *LibP2PMetrics) BlockProtocol(proto protocol.ID) { 82 _m.Called(proto) 83 } 84 85 // BlockProtocolPeer provides a mock function with given fields: proto, p 86 func (_m *LibP2PMetrics) BlockProtocolPeer(proto protocol.ID, p peer.ID) { 87 _m.Called(proto, p) 88 } 89 90 // BlockService provides a mock function with given fields: svc 91 func (_m *LibP2PMetrics) BlockService(svc string) { 92 _m.Called(svc) 93 } 94 95 // BlockServicePeer provides a mock function with given fields: svc, p 96 func (_m *LibP2PMetrics) BlockServicePeer(svc string, p peer.ID) { 97 _m.Called(svc, p) 98 } 99 100 // BlockStream provides a mock function with given fields: p, dir 101 func (_m *LibP2PMetrics) BlockStream(p peer.ID, dir network.Direction) { 102 _m.Called(p, dir) 103 } 104 105 // DNSLookupDuration provides a mock function with given fields: duration 106 func (_m *LibP2PMetrics) DNSLookupDuration(duration time.Duration) { 107 _m.Called(duration) 108 } 109 110 // DuplicateMessagePenalties provides a mock function with given fields: penalty 111 func (_m *LibP2PMetrics) DuplicateMessagePenalties(penalty float64) { 112 _m.Called(penalty) 113 } 114 115 // DuplicateMessagesCounts provides a mock function with given fields: count 116 func (_m *LibP2PMetrics) DuplicateMessagesCounts(count float64) { 117 _m.Called(count) 118 } 119 120 // InboundConnections provides a mock function with given fields: connectionCount 121 func (_m *LibP2PMetrics) InboundConnections(connectionCount uint) { 122 _m.Called(connectionCount) 123 } 124 125 // OnActiveClusterIDsNotSetErr provides a mock function with given fields: 126 func (_m *LibP2PMetrics) OnActiveClusterIDsNotSetErr() { 127 _m.Called() 128 } 129 130 // OnAppSpecificScoreUpdated provides a mock function with given fields: _a0 131 func (_m *LibP2PMetrics) OnAppSpecificScoreUpdated(_a0 float64) { 132 _m.Called(_a0) 133 } 134 135 // OnBehaviourPenaltyUpdated provides a mock function with given fields: _a0 136 func (_m *LibP2PMetrics) OnBehaviourPenaltyUpdated(_a0 float64) { 137 _m.Called(_a0) 138 } 139 140 // OnControlMessagesTruncated provides a mock function with given fields: messageType, diff 141 func (_m *LibP2PMetrics) OnControlMessagesTruncated(messageType p2pmsg.ControlMessageType, diff int) { 142 _m.Called(messageType, diff) 143 } 144 145 // OnDNSCacheHit provides a mock function with given fields: 146 func (_m *LibP2PMetrics) OnDNSCacheHit() { 147 _m.Called() 148 } 149 150 // OnDNSCacheInvalidated provides a mock function with given fields: 151 func (_m *LibP2PMetrics) OnDNSCacheInvalidated() { 152 _m.Called() 153 } 154 155 // OnDNSCacheMiss provides a mock function with given fields: 156 func (_m *LibP2PMetrics) OnDNSCacheMiss() { 157 _m.Called() 158 } 159 160 // OnDNSLookupRequestDropped provides a mock function with given fields: 161 func (_m *LibP2PMetrics) OnDNSLookupRequestDropped() { 162 _m.Called() 163 } 164 165 // OnDialRetryBudgetResetToDefault provides a mock function with given fields: 166 func (_m *LibP2PMetrics) OnDialRetryBudgetResetToDefault() { 167 _m.Called() 168 } 169 170 // OnDialRetryBudgetUpdated provides a mock function with given fields: budget 171 func (_m *LibP2PMetrics) OnDialRetryBudgetUpdated(budget uint64) { 172 _m.Called(budget) 173 } 174 175 // OnEstablishStreamFailure provides a mock function with given fields: duration, attempts 176 func (_m *LibP2PMetrics) OnEstablishStreamFailure(duration time.Duration, attempts int) { 177 _m.Called(duration, attempts) 178 } 179 180 // OnFirstMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 181 func (_m *LibP2PMetrics) OnFirstMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 182 _m.Called(_a0, _a1) 183 } 184 185 // OnGraftDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 186 func (_m *LibP2PMetrics) OnGraftDuplicateTopicIdsExceedThreshold() { 187 _m.Called() 188 } 189 190 // OnGraftInvalidTopicIdsExceedThreshold provides a mock function with given fields: 191 func (_m *LibP2PMetrics) OnGraftInvalidTopicIdsExceedThreshold() { 192 _m.Called() 193 } 194 195 // OnGraftMessageInspected provides a mock function with given fields: duplicateTopicIds, invalidTopicIds 196 func (_m *LibP2PMetrics) OnGraftMessageInspected(duplicateTopicIds int, invalidTopicIds int) { 197 _m.Called(duplicateTopicIds, invalidTopicIds) 198 } 199 200 // OnIHaveControlMessageIdsTruncated provides a mock function with given fields: diff 201 func (_m *LibP2PMetrics) OnIHaveControlMessageIdsTruncated(diff int) { 202 _m.Called(diff) 203 } 204 205 // OnIHaveDuplicateMessageIdsExceedThreshold provides a mock function with given fields: 206 func (_m *LibP2PMetrics) OnIHaveDuplicateMessageIdsExceedThreshold() { 207 _m.Called() 208 } 209 210 // OnIHaveDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 211 func (_m *LibP2PMetrics) OnIHaveDuplicateTopicIdsExceedThreshold() { 212 _m.Called() 213 } 214 215 // OnIHaveInvalidTopicIdsExceedThreshold provides a mock function with given fields: 216 func (_m *LibP2PMetrics) OnIHaveInvalidTopicIdsExceedThreshold() { 217 _m.Called() 218 } 219 220 // OnIHaveMessageIDsReceived provides a mock function with given fields: channel, msgIdCount 221 func (_m *LibP2PMetrics) OnIHaveMessageIDsReceived(channel string, msgIdCount int) { 222 _m.Called(channel, msgIdCount) 223 } 224 225 // OnIHaveMessagesInspected provides a mock function with given fields: duplicateTopicIds, duplicateMessageIds, invalidTopicIds 226 func (_m *LibP2PMetrics) OnIHaveMessagesInspected(duplicateTopicIds int, duplicateMessageIds int, invalidTopicIds int) { 227 _m.Called(duplicateTopicIds, duplicateMessageIds, invalidTopicIds) 228 } 229 230 // OnIPColocationFactorUpdated provides a mock function with given fields: _a0 231 func (_m *LibP2PMetrics) OnIPColocationFactorUpdated(_a0 float64) { 232 _m.Called(_a0) 233 } 234 235 // OnIWantCacheMissMessageIdsExceedThreshold provides a mock function with given fields: 236 func (_m *LibP2PMetrics) OnIWantCacheMissMessageIdsExceedThreshold() { 237 _m.Called() 238 } 239 240 // OnIWantControlMessageIdsTruncated provides a mock function with given fields: diff 241 func (_m *LibP2PMetrics) OnIWantControlMessageIdsTruncated(diff int) { 242 _m.Called(diff) 243 } 244 245 // OnIWantDuplicateMessageIdsExceedThreshold provides a mock function with given fields: 246 func (_m *LibP2PMetrics) OnIWantDuplicateMessageIdsExceedThreshold() { 247 _m.Called() 248 } 249 250 // OnIWantMessageIDsReceived provides a mock function with given fields: msgIdCount 251 func (_m *LibP2PMetrics) OnIWantMessageIDsReceived(msgIdCount int) { 252 _m.Called(msgIdCount) 253 } 254 255 // OnIWantMessagesInspected provides a mock function with given fields: duplicateCount, cacheMissCount 256 func (_m *LibP2PMetrics) OnIWantMessagesInspected(duplicateCount int, cacheMissCount int) { 257 _m.Called(duplicateCount, cacheMissCount) 258 } 259 260 // OnIncomingRpcReceived provides a mock function with given fields: iHaveCount, iWantCount, graftCount, pruneCount, msgCount 261 func (_m *LibP2PMetrics) OnIncomingRpcReceived(iHaveCount int, iWantCount int, graftCount int, pruneCount int, msgCount int) { 262 _m.Called(iHaveCount, iWantCount, graftCount, pruneCount, msgCount) 263 } 264 265 // OnInvalidControlMessageNotificationSent provides a mock function with given fields: 266 func (_m *LibP2PMetrics) OnInvalidControlMessageNotificationSent() { 267 _m.Called() 268 } 269 270 // OnInvalidMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 271 func (_m *LibP2PMetrics) OnInvalidMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 272 _m.Called(_a0, _a1) 273 } 274 275 // OnInvalidTopicIdDetectedForControlMessage provides a mock function with given fields: messageType 276 func (_m *LibP2PMetrics) OnInvalidTopicIdDetectedForControlMessage(messageType p2pmsg.ControlMessageType) { 277 _m.Called(messageType) 278 } 279 280 // OnLocalMeshSizeUpdated provides a mock function with given fields: topic, size 281 func (_m *LibP2PMetrics) OnLocalMeshSizeUpdated(topic string, size int) { 282 _m.Called(topic, size) 283 } 284 285 // OnLocalPeerJoinedTopic provides a mock function with given fields: 286 func (_m *LibP2PMetrics) OnLocalPeerJoinedTopic() { 287 _m.Called() 288 } 289 290 // OnLocalPeerLeftTopic provides a mock function with given fields: 291 func (_m *LibP2PMetrics) OnLocalPeerLeftTopic() { 292 _m.Called() 293 } 294 295 // OnMeshMessageDeliveredUpdated provides a mock function with given fields: _a0, _a1 296 func (_m *LibP2PMetrics) OnMeshMessageDeliveredUpdated(_a0 channels.Topic, _a1 float64) { 297 _m.Called(_a0, _a1) 298 } 299 300 // OnMessageDeliveredToAllSubscribers provides a mock function with given fields: size 301 func (_m *LibP2PMetrics) OnMessageDeliveredToAllSubscribers(size int) { 302 _m.Called(size) 303 } 304 305 // OnMessageDuplicate provides a mock function with given fields: size 306 func (_m *LibP2PMetrics) OnMessageDuplicate(size int) { 307 _m.Called(size) 308 } 309 310 // OnMessageEnteredValidation provides a mock function with given fields: size 311 func (_m *LibP2PMetrics) OnMessageEnteredValidation(size int) { 312 _m.Called(size) 313 } 314 315 // OnMessageRejected provides a mock function with given fields: size, reason 316 func (_m *LibP2PMetrics) OnMessageRejected(size int, reason string) { 317 _m.Called(size, reason) 318 } 319 320 // OnOutboundRpcDropped provides a mock function with given fields: 321 func (_m *LibP2PMetrics) OnOutboundRpcDropped() { 322 _m.Called() 323 } 324 325 // OnOverallPeerScoreUpdated provides a mock function with given fields: _a0 326 func (_m *LibP2PMetrics) OnOverallPeerScoreUpdated(_a0 float64) { 327 _m.Called(_a0) 328 } 329 330 // OnPeerAddedToProtocol provides a mock function with given fields: _a0 331 func (_m *LibP2PMetrics) OnPeerAddedToProtocol(_a0 string) { 332 _m.Called(_a0) 333 } 334 335 // OnPeerDialFailure provides a mock function with given fields: duration, attempts 336 func (_m *LibP2PMetrics) OnPeerDialFailure(duration time.Duration, attempts int) { 337 _m.Called(duration, attempts) 338 } 339 340 // OnPeerDialed provides a mock function with given fields: duration, attempts 341 func (_m *LibP2PMetrics) OnPeerDialed(duration time.Duration, attempts int) { 342 _m.Called(duration, attempts) 343 } 344 345 // OnPeerGraftTopic provides a mock function with given fields: topic 346 func (_m *LibP2PMetrics) OnPeerGraftTopic(topic string) { 347 _m.Called(topic) 348 } 349 350 // OnPeerPruneTopic provides a mock function with given fields: topic 351 func (_m *LibP2PMetrics) OnPeerPruneTopic(topic string) { 352 _m.Called(topic) 353 } 354 355 // OnPeerRemovedFromProtocol provides a mock function with given fields: 356 func (_m *LibP2PMetrics) OnPeerRemovedFromProtocol() { 357 _m.Called() 358 } 359 360 // OnPeerThrottled provides a mock function with given fields: 361 func (_m *LibP2PMetrics) OnPeerThrottled() { 362 _m.Called() 363 } 364 365 // OnPruneDuplicateTopicIdsExceedThreshold provides a mock function with given fields: 366 func (_m *LibP2PMetrics) OnPruneDuplicateTopicIdsExceedThreshold() { 367 _m.Called() 368 } 369 370 // OnPruneInvalidTopicIdsExceedThreshold provides a mock function with given fields: 371 func (_m *LibP2PMetrics) OnPruneInvalidTopicIdsExceedThreshold() { 372 _m.Called() 373 } 374 375 // OnPruneMessageInspected provides a mock function with given fields: duplicateTopicIds, invalidTopicIds 376 func (_m *LibP2PMetrics) OnPruneMessageInspected(duplicateTopicIds int, invalidTopicIds int) { 377 _m.Called(duplicateTopicIds, invalidTopicIds) 378 } 379 380 // OnPublishMessageInspected provides a mock function with given fields: totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount 381 func (_m *LibP2PMetrics) OnPublishMessageInspected(totalErrCount int, invalidTopicIdsCount int, invalidSubscriptionsCount int, invalidSendersCount int) { 382 _m.Called(totalErrCount, invalidTopicIdsCount, invalidSubscriptionsCount, invalidSendersCount) 383 } 384 385 // OnPublishMessagesInspectionErrorExceedsThreshold provides a mock function with given fields: 386 func (_m *LibP2PMetrics) OnPublishMessagesInspectionErrorExceedsThreshold() { 387 _m.Called() 388 } 389 390 // OnRpcReceived provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount 391 func (_m *LibP2PMetrics) OnRpcReceived(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) { 392 _m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount) 393 } 394 395 // OnRpcRejectedFromUnknownSender provides a mock function with given fields: 396 func (_m *LibP2PMetrics) OnRpcRejectedFromUnknownSender() { 397 _m.Called() 398 } 399 400 // OnRpcSent provides a mock function with given fields: msgCount, iHaveCount, iWantCount, graftCount, pruneCount 401 func (_m *LibP2PMetrics) OnRpcSent(msgCount int, iHaveCount int, iWantCount int, graftCount int, pruneCount int) { 402 _m.Called(msgCount, iHaveCount, iWantCount, graftCount, pruneCount) 403 } 404 405 // OnStreamCreated provides a mock function with given fields: duration, attempts 406 func (_m *LibP2PMetrics) OnStreamCreated(duration time.Duration, attempts int) { 407 _m.Called(duration, attempts) 408 } 409 410 // OnStreamCreationFailure provides a mock function with given fields: duration, attempts 411 func (_m *LibP2PMetrics) OnStreamCreationFailure(duration time.Duration, attempts int) { 412 _m.Called(duration, attempts) 413 } 414 415 // OnStreamCreationRetryBudgetResetToDefault provides a mock function with given fields: 416 func (_m *LibP2PMetrics) OnStreamCreationRetryBudgetResetToDefault() { 417 _m.Called() 418 } 419 420 // OnStreamCreationRetryBudgetUpdated provides a mock function with given fields: budget 421 func (_m *LibP2PMetrics) OnStreamCreationRetryBudgetUpdated(budget uint64) { 422 _m.Called(budget) 423 } 424 425 // OnStreamEstablished provides a mock function with given fields: duration, attempts 426 func (_m *LibP2PMetrics) OnStreamEstablished(duration time.Duration, attempts int) { 427 _m.Called(duration, attempts) 428 } 429 430 // OnTimeInMeshUpdated provides a mock function with given fields: _a0, _a1 431 func (_m *LibP2PMetrics) OnTimeInMeshUpdated(_a0 channels.Topic, _a1 time.Duration) { 432 _m.Called(_a0, _a1) 433 } 434 435 // OnUndeliveredMessage provides a mock function with given fields: 436 func (_m *LibP2PMetrics) OnUndeliveredMessage() { 437 _m.Called() 438 } 439 440 // OnUnstakedPeerInspectionFailed provides a mock function with given fields: 441 func (_m *LibP2PMetrics) OnUnstakedPeerInspectionFailed() { 442 _m.Called() 443 } 444 445 // OutboundConnections provides a mock function with given fields: connectionCount 446 func (_m *LibP2PMetrics) OutboundConnections(connectionCount uint) { 447 _m.Called(connectionCount) 448 } 449 450 // RoutingTablePeerAdded provides a mock function with given fields: 451 func (_m *LibP2PMetrics) RoutingTablePeerAdded() { 452 _m.Called() 453 } 454 455 // RoutingTablePeerRemoved provides a mock function with given fields: 456 func (_m *LibP2PMetrics) RoutingTablePeerRemoved() { 457 _m.Called() 458 } 459 460 // SetWarningStateCount provides a mock function with given fields: _a0 461 func (_m *LibP2PMetrics) SetWarningStateCount(_a0 uint) { 462 _m.Called(_a0) 463 } 464 465 type mockConstructorTestingTNewLibP2PMetrics interface { 466 mock.TestingT 467 Cleanup(func()) 468 } 469 470 // 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. 471 func NewLibP2PMetrics(t mockConstructorTestingTNewLibP2PMetrics) *LibP2PMetrics { 472 mock := &LibP2PMetrics{} 473 mock.Mock.Test(t) 474 475 t.Cleanup(func() { mock.AssertExpectations(t) }) 476 477 return mock 478 }