github.com/koko1123/flow-go-1@v0.29.6/module/mock/network_metrics.go (about) 1 // Code generated by mockery v2.13.1. DO NOT EDIT. 2 3 package mock 4 5 import ( 6 mock "github.com/stretchr/testify/mock" 7 8 network "github.com/libp2p/go-libp2p/core/network" 9 10 peer "github.com/libp2p/go-libp2p/core/peer" 11 12 protocol "github.com/libp2p/go-libp2p/core/protocol" 13 14 time "time" 15 ) 16 17 // NetworkMetrics is an autogenerated mock type for the NetworkMetrics type 18 type NetworkMetrics struct { 19 mock.Mock 20 } 21 22 // AllowConn provides a mock function with given fields: dir, usefd 23 func (_m *NetworkMetrics) AllowConn(dir network.Direction, usefd bool) { 24 _m.Called(dir, usefd) 25 } 26 27 // AllowMemory provides a mock function with given fields: size 28 func (_m *NetworkMetrics) AllowMemory(size int) { 29 _m.Called(size) 30 } 31 32 // AllowPeer provides a mock function with given fields: p 33 func (_m *NetworkMetrics) AllowPeer(p peer.ID) { 34 _m.Called(p) 35 } 36 37 // AllowProtocol provides a mock function with given fields: proto 38 func (_m *NetworkMetrics) AllowProtocol(proto protocol.ID) { 39 _m.Called(proto) 40 } 41 42 // AllowService provides a mock function with given fields: svc 43 func (_m *NetworkMetrics) AllowService(svc string) { 44 _m.Called(svc) 45 } 46 47 // AllowStream provides a mock function with given fields: p, dir 48 func (_m *NetworkMetrics) AllowStream(p peer.ID, dir network.Direction) { 49 _m.Called(p, dir) 50 } 51 52 // BlockConn provides a mock function with given fields: dir, usefd 53 func (_m *NetworkMetrics) BlockConn(dir network.Direction, usefd bool) { 54 _m.Called(dir, usefd) 55 } 56 57 // BlockMemory provides a mock function with given fields: size 58 func (_m *NetworkMetrics) BlockMemory(size int) { 59 _m.Called(size) 60 } 61 62 // BlockPeer provides a mock function with given fields: p 63 func (_m *NetworkMetrics) BlockPeer(p peer.ID) { 64 _m.Called(p) 65 } 66 67 // BlockProtocol provides a mock function with given fields: proto 68 func (_m *NetworkMetrics) BlockProtocol(proto protocol.ID) { 69 _m.Called(proto) 70 } 71 72 // BlockProtocolPeer provides a mock function with given fields: proto, p 73 func (_m *NetworkMetrics) BlockProtocolPeer(proto protocol.ID, p peer.ID) { 74 _m.Called(proto, p) 75 } 76 77 // BlockService provides a mock function with given fields: svc 78 func (_m *NetworkMetrics) BlockService(svc string) { 79 _m.Called(svc) 80 } 81 82 // BlockServicePeer provides a mock function with given fields: svc, p 83 func (_m *NetworkMetrics) BlockServicePeer(svc string, p peer.ID) { 84 _m.Called(svc, p) 85 } 86 87 // BlockStream provides a mock function with given fields: p, dir 88 func (_m *NetworkMetrics) BlockStream(p peer.ID, dir network.Direction) { 89 _m.Called(p, dir) 90 } 91 92 // DNSLookupDuration provides a mock function with given fields: duration 93 func (_m *NetworkMetrics) DNSLookupDuration(duration time.Duration) { 94 _m.Called(duration) 95 } 96 97 // DuplicateInboundMessagesDropped provides a mock function with given fields: topic, _a1, messageType 98 func (_m *NetworkMetrics) DuplicateInboundMessagesDropped(topic string, _a1 string, messageType string) { 99 _m.Called(topic, _a1, messageType) 100 } 101 102 // InboundConnections provides a mock function with given fields: connectionCount 103 func (_m *NetworkMetrics) InboundConnections(connectionCount uint) { 104 _m.Called(connectionCount) 105 } 106 107 // InboundMessageReceived provides a mock function with given fields: sizeBytes, topic, _a2, messageType 108 func (_m *NetworkMetrics) InboundMessageReceived(sizeBytes int, topic string, _a2 string, messageType string) { 109 _m.Called(sizeBytes, topic, _a2, messageType) 110 } 111 112 // MessageAdded provides a mock function with given fields: priority 113 func (_m *NetworkMetrics) MessageAdded(priority int) { 114 _m.Called(priority) 115 } 116 117 // MessageProcessingFinished provides a mock function with given fields: topic, duration 118 func (_m *NetworkMetrics) MessageProcessingFinished(topic string, duration time.Duration) { 119 _m.Called(topic, duration) 120 } 121 122 // MessageProcessingStarted provides a mock function with given fields: topic 123 func (_m *NetworkMetrics) MessageProcessingStarted(topic string) { 124 _m.Called(topic) 125 } 126 127 // MessageRemoved provides a mock function with given fields: priority 128 func (_m *NetworkMetrics) MessageRemoved(priority int) { 129 _m.Called(priority) 130 } 131 132 // OnDNSCacheHit provides a mock function with given fields: 133 func (_m *NetworkMetrics) OnDNSCacheHit() { 134 _m.Called() 135 } 136 137 // OnDNSCacheInvalidated provides a mock function with given fields: 138 func (_m *NetworkMetrics) OnDNSCacheInvalidated() { 139 _m.Called() 140 } 141 142 // OnDNSCacheMiss provides a mock function with given fields: 143 func (_m *NetworkMetrics) OnDNSCacheMiss() { 144 _m.Called() 145 } 146 147 // OnDNSLookupRequestDropped provides a mock function with given fields: 148 func (_m *NetworkMetrics) OnDNSLookupRequestDropped() { 149 _m.Called() 150 } 151 152 // OnGraftReceived provides a mock function with given fields: count 153 func (_m *NetworkMetrics) OnGraftReceived(count int) { 154 _m.Called(count) 155 } 156 157 // OnIHaveReceived provides a mock function with given fields: count 158 func (_m *NetworkMetrics) OnIHaveReceived(count int) { 159 _m.Called(count) 160 } 161 162 // OnIWantReceived provides a mock function with given fields: count 163 func (_m *NetworkMetrics) OnIWantReceived(count int) { 164 _m.Called(count) 165 } 166 167 // OnIncomingRpcAcceptedFully provides a mock function with given fields: 168 func (_m *NetworkMetrics) OnIncomingRpcAcceptedFully() { 169 _m.Called() 170 } 171 172 // OnIncomingRpcAcceptedOnlyForControlMessages provides a mock function with given fields: 173 func (_m *NetworkMetrics) OnIncomingRpcAcceptedOnlyForControlMessages() { 174 _m.Called() 175 } 176 177 // OnIncomingRpcRejected provides a mock function with given fields: 178 func (_m *NetworkMetrics) OnIncomingRpcRejected() { 179 _m.Called() 180 } 181 182 // OnPruneReceived provides a mock function with given fields: count 183 func (_m *NetworkMetrics) OnPruneReceived(count int) { 184 _m.Called(count) 185 } 186 187 // OnPublishedGossipMessagesReceived provides a mock function with given fields: count 188 func (_m *NetworkMetrics) OnPublishedGossipMessagesReceived(count int) { 189 _m.Called(count) 190 } 191 192 // OnRateLimitedUnicastMessage provides a mock function with given fields: role, msgType, topic, reason 193 func (_m *NetworkMetrics) OnRateLimitedUnicastMessage(role string, msgType string, topic string, reason string) { 194 _m.Called(role, msgType, topic, reason) 195 } 196 197 // OnUnauthorizedMessage provides a mock function with given fields: role, msgType, topic, offense 198 func (_m *NetworkMetrics) OnUnauthorizedMessage(role string, msgType string, topic string, offense string) { 199 _m.Called(role, msgType, topic, offense) 200 } 201 202 // OutboundConnections provides a mock function with given fields: connectionCount 203 func (_m *NetworkMetrics) OutboundConnections(connectionCount uint) { 204 _m.Called(connectionCount) 205 } 206 207 // OutboundMessageSent provides a mock function with given fields: sizeBytes, topic, _a2, messageType 208 func (_m *NetworkMetrics) OutboundMessageSent(sizeBytes int, topic string, _a2 string, messageType string) { 209 _m.Called(sizeBytes, topic, _a2, messageType) 210 } 211 212 // QueueDuration provides a mock function with given fields: duration, priority 213 func (_m *NetworkMetrics) QueueDuration(duration time.Duration, priority int) { 214 _m.Called(duration, priority) 215 } 216 217 // RoutingTablePeerAdded provides a mock function with given fields: 218 func (_m *NetworkMetrics) RoutingTablePeerAdded() { 219 _m.Called() 220 } 221 222 // RoutingTablePeerRemoved provides a mock function with given fields: 223 func (_m *NetworkMetrics) RoutingTablePeerRemoved() { 224 _m.Called() 225 } 226 227 // UnicastMessageSendingCompleted provides a mock function with given fields: topic 228 func (_m *NetworkMetrics) UnicastMessageSendingCompleted(topic string) { 229 _m.Called(topic) 230 } 231 232 // UnicastMessageSendingStarted provides a mock function with given fields: topic 233 func (_m *NetworkMetrics) UnicastMessageSendingStarted(topic string) { 234 _m.Called(topic) 235 } 236 237 type mockConstructorTestingTNewNetworkMetrics interface { 238 mock.TestingT 239 Cleanup(func()) 240 } 241 242 // NewNetworkMetrics creates a new instance of NetworkMetrics. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 243 func NewNetworkMetrics(t mockConstructorTestingTNewNetworkMetrics) *NetworkMetrics { 244 mock := &NetworkMetrics{} 245 mock.Mock.Test(t) 246 247 t.Cleanup(func() { mock.AssertExpectations(t) }) 248 249 return mock 250 }