github.com/koko1123/flow-go-1@v0.29.6/module/metrics/noop.go (about)

     1  package metrics
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/libp2p/go-libp2p/core/network"
     7  	"github.com/libp2p/go-libp2p/core/peer"
     8  	"github.com/libp2p/go-libp2p/core/protocol"
     9  
    10  	"github.com/koko1123/flow-go-1/model/chainsync"
    11  	"github.com/koko1123/flow-go-1/model/cluster"
    12  	"github.com/koko1123/flow-go-1/model/flow"
    13  	"github.com/koko1123/flow-go-1/module"
    14  )
    15  
    16  type NoopCollector struct{}
    17  
    18  func (nc *NoopCollector) Peers(prefix string, n int)                                     {}
    19  func (nc *NoopCollector) Wantlist(prefix string, n int)                                  {}
    20  func (nc *NoopCollector) BlobsReceived(prefix string, n uint64)                          {}
    21  func (nc *NoopCollector) DataReceived(prefix string, n uint64)                           {}
    22  func (nc *NoopCollector) BlobsSent(prefix string, n uint64)                              {}
    23  func (nc *NoopCollector) DataSent(prefix string, n uint64)                               {}
    24  func (nc *NoopCollector) DupBlobsReceived(prefix string, n uint64)                       {}
    25  func (nc *NoopCollector) DupDataReceived(prefix string, n uint64)                        {}
    26  func (nc *NoopCollector) MessagesReceived(prefix string, n uint64)                       {}
    27  func (nc *NoopCollector) OutboundMessageSent(int, string, string, string)                {}
    28  func (nc *NoopCollector) InboundMessageReceived(int, string, string, string)             {}
    29  func (nc *NoopCollector) DuplicateInboundMessagesDropped(string, string, string)         {}
    30  func (nc *NoopCollector) MessageAdded(priority int)                                      {}
    31  func (nc *NoopCollector) MessageRemoved(priority int)                                    {}
    32  func (nc *NoopCollector) QueueDuration(duration time.Duration, priority int)             {}
    33  func (nc *NoopCollector) MessageProcessingStarted(topic string)                          {}
    34  func (nc *NoopCollector) MessageProcessingFinished(topic string, duration time.Duration) {}
    35  func (nc *NoopCollector) UnicastMessageSendingStarted(topic string)                      {}
    36  func (nc *NoopCollector) UnicastMessageSendingCompleted(topic string)                    {}
    37  func (nc *NoopCollector) MessageSent(engine string, message string)                      {}
    38  func (nc *NoopCollector) MessageReceived(engine string, message string)                  {}
    39  func (nc *NoopCollector) MessageHandled(engine string, message string)                   {}
    40  func (nc *NoopCollector) OutboundConnections(_ uint)                                     {}
    41  func (nc *NoopCollector) InboundConnections(_ uint)                                      {}
    42  func (nc *NoopCollector) DNSLookupDuration(duration time.Duration)                       {}
    43  func (nc *NoopCollector) OnDNSCacheMiss()                                                {}
    44  func (nc *NoopCollector) OnDNSCacheInvalidated()                                         {}
    45  func (nc *NoopCollector) OnDNSCacheHit()                                                 {}
    46  func (nc *NoopCollector) OnDNSLookupRequestDropped()                                     {}
    47  func (nc *NoopCollector) UnstakedOutboundConnections(_ uint)                             {}
    48  func (nc *NoopCollector) UnstakedInboundConnections(_ uint)                              {}
    49  func (nc *NoopCollector) RanGC(duration time.Duration)                                   {}
    50  func (nc *NoopCollector) BadgerLSMSize(sizeBytes int64)                                  {}
    51  func (nc *NoopCollector) BadgerVLogSize(sizeBytes int64)                                 {}
    52  func (nc *NoopCollector) BadgerNumReads(n int64)                                         {}
    53  func (nc *NoopCollector) BadgerNumWrites(n int64)                                        {}
    54  func (nc *NoopCollector) BadgerNumBytesRead(n int64)                                     {}
    55  func (nc *NoopCollector) BadgerNumBytesWritten(n int64)                                  {}
    56  func (nc *NoopCollector) BadgerNumGets(n int64)                                          {}
    57  func (nc *NoopCollector) BadgerNumPuts(n int64)                                          {}
    58  func (nc *NoopCollector) BadgerNumBlockedPuts(n int64)                                   {}
    59  func (nc *NoopCollector) BadgerNumMemtableGets(n int64)                                  {}
    60  func (nc *NoopCollector) FinalizedHeight(height uint64)                                  {}
    61  func (nc *NoopCollector) SealedHeight(height uint64)                                     {}
    62  func (nc *NoopCollector) BlockProposed(*flow.Block)                                      {}
    63  func (nc *NoopCollector) BlockFinalized(*flow.Block)                                     {}
    64  func (nc *NoopCollector) BlockSealed(*flow.Block)                                        {}
    65  func (nc *NoopCollector) BlockProposalDuration(duration time.Duration)                   {}
    66  func (nc *NoopCollector) CommittedEpochFinalView(view uint64)                            {}
    67  func (nc *NoopCollector) CurrentEpochCounter(counter uint64)                             {}
    68  func (nc *NoopCollector) CurrentEpochPhase(phase flow.EpochPhase)                        {}
    69  func (nc *NoopCollector) CurrentEpochFinalView(view uint64)                              {}
    70  func (nc *NoopCollector) CurrentDKGPhase1FinalView(view uint64)                          {}
    71  func (nc *NoopCollector) CurrentDKGPhase2FinalView(view uint64)                          {}
    72  func (nc *NoopCollector) CurrentDKGPhase3FinalView(view uint64)                          {}
    73  func (nc *NoopCollector) EpochEmergencyFallbackTriggered()                               {}
    74  func (nc *NoopCollector) CacheEntries(resource string, entries uint)                     {}
    75  func (nc *NoopCollector) CacheHit(resource string)                                       {}
    76  func (nc *NoopCollector) CacheNotFound(resource string)                                  {}
    77  func (nc *NoopCollector) CacheMiss(resource string)                                      {}
    78  func (nc *NoopCollector) MempoolEntries(resource string, entries uint)                   {}
    79  func (nc *NoopCollector) Register(resource string, entriesFunc module.EntriesFunc) error { return nil }
    80  func (nc *NoopCollector) HotStuffBusyDuration(duration time.Duration, event string)      {}
    81  func (nc *NoopCollector) HotStuffIdleDuration(duration time.Duration)                    {}
    82  func (nc *NoopCollector) HotStuffWaitDuration(duration time.Duration, event string)      {}
    83  func (nc *NoopCollector) SetCurView(view uint64)                                         {}
    84  func (nc *NoopCollector) SetQCView(view uint64)                                          {}
    85  func (nc *NoopCollector) CountSkipped()                                                  {}
    86  func (nc *NoopCollector) CountTimeout()                                                  {}
    87  func (nc *NoopCollector) SetTimeout(duration time.Duration)                              {}
    88  func (nc *NoopCollector) CommitteeProcessingDuration(duration time.Duration)             {}
    89  func (nc *NoopCollector) SignerProcessingDuration(duration time.Duration)                {}
    90  func (nc *NoopCollector) ValidatorProcessingDuration(duration time.Duration)             {}
    91  func (nc *NoopCollector) PayloadProductionDuration(duration time.Duration)               {}
    92  func (nc *NoopCollector) TransactionIngested(txID flow.Identifier)                       {}
    93  func (nc *NoopCollector) ClusterBlockProposed(*cluster.Block)                            {}
    94  func (nc *NoopCollector) ClusterBlockFinalized(*cluster.Block)                           {}
    95  func (nc *NoopCollector) StartCollectionToFinalized(collectionID flow.Identifier)        {}
    96  func (nc *NoopCollector) FinishCollectionToFinalized(collectionID flow.Identifier)       {}
    97  func (nc *NoopCollector) StartBlockToSeal(blockID flow.Identifier)                       {}
    98  func (nc *NoopCollector) FinishBlockToSeal(blockID flow.Identifier)                      {}
    99  func (nc *NoopCollector) EmergencySeal()                                                 {}
   100  func (nc *NoopCollector) OnReceiptProcessingDuration(duration time.Duration)             {}
   101  func (nc *NoopCollector) OnApprovalProcessingDuration(duration time.Duration)            {}
   102  func (nc *NoopCollector) CheckSealingDuration(duration time.Duration)                    {}
   103  func (nc *NoopCollector) OnExecutionResultReceivedAtAssignerEngine()                     {}
   104  func (nc *NoopCollector) OnVerifiableChunkReceivedAtVerifierEngine()                     {}
   105  func (nc *NoopCollector) OnResultApprovalDispatchedInNetworkByVerifier()                 {}
   106  func (nc *NoopCollector) SetMaxChunkDataPackAttemptsForNextUnsealedHeightAtRequester(attempts uint64) {
   107  }
   108  func (nc *NoopCollector) OnFinalizedBlockArrivedAtAssigner(height uint64)                       {}
   109  func (nc *NoopCollector) OnChunksAssignmentDoneAtAssigner(chunks int)                           {}
   110  func (nc *NoopCollector) OnAssignedChunkProcessedAtAssigner()                                   {}
   111  func (nc *NoopCollector) OnAssignedChunkReceivedAtFetcher()                                     {}
   112  func (nc *NoopCollector) OnChunkDataPackRequestDispatchedInNetworkByRequester()                 {}
   113  func (nc *NoopCollector) OnChunkDataPackRequestSentByFetcher()                                  {}
   114  func (nc *NoopCollector) OnChunkDataPackRequestReceivedByRequester()                            {}
   115  func (nc *NoopCollector) OnChunkDataPackArrivedAtFetcher()                                      {}
   116  func (nc *NoopCollector) OnChunkDataPackSentToFetcher()                                         {}
   117  func (nc *NoopCollector) OnVerifiableChunkSentToVerifier()                                      {}
   118  func (nc *NoopCollector) OnBlockConsumerJobDone(uint64)                                         {}
   119  func (nc *NoopCollector) OnChunkConsumerJobDone(uint64)                                         {}
   120  func (nc *NoopCollector) OnChunkDataPackResponseReceivedFromNetworkByRequester()                {}
   121  func (nc *NoopCollector) TotalConnectionsInPool(connectionCount uint, connectionPoolSize uint)  {}
   122  func (nc *NoopCollector) ConnectionFromPoolReused()                                             {}
   123  func (nc *NoopCollector) ConnectionAddedToPool()                                                {}
   124  func (nc *NoopCollector) NewConnectionEstablished()                                             {}
   125  func (nc *NoopCollector) ConnectionFromPoolInvalidated()                                        {}
   126  func (nc *NoopCollector) ConnectionFromPoolUpdated()                                            {}
   127  func (nc *NoopCollector) ConnectionFromPoolEvicted()                                            {}
   128  func (nc *NoopCollector) StartBlockReceivedToExecuted(blockID flow.Identifier)                  {}
   129  func (nc *NoopCollector) FinishBlockReceivedToExecuted(blockID flow.Identifier)                 {}
   130  func (nc *NoopCollector) ExecutionComputationUsedPerBlock(computation uint64)                   {}
   131  func (nc *NoopCollector) ExecutionStorageStateCommitment(bytes int64)                           {}
   132  func (nc *NoopCollector) ExecutionLastExecutedBlockHeight(height uint64)                        {}
   133  func (nc *NoopCollector) ExecutionBlockExecuted(_ time.Duration, _ module.ExecutionResultStats) {}
   134  func (nc *NoopCollector) ExecutionCollectionExecuted(_ time.Duration, _ module.ExecutionResultStats) {
   135  }
   136  func (nc *NoopCollector) ExecutionBlockExecutionEffortVectorComponent(_ string, _ uint) {}
   137  func (nc *NoopCollector) ExecutionTransactionExecuted(_ time.Duration, _, _, _ uint64, _, _ int, _ bool) {
   138  }
   139  func (nc *NoopCollector) ExecutionChunkDataPackGenerated(_, _ int)                         {}
   140  func (nc *NoopCollector) ExecutionScriptExecuted(dur time.Duration, compUsed, _, _ uint64) {}
   141  func (nc *NoopCollector) ForestApproxMemorySize(bytes uint64)                              {}
   142  func (nc *NoopCollector) ForestNumberOfTrees(number uint64)                                {}
   143  func (nc *NoopCollector) LatestTrieRegCount(number uint64)                                 {}
   144  func (nc *NoopCollector) LatestTrieRegCountDiff(number int64)                              {}
   145  func (nc *NoopCollector) LatestTrieRegSize(size uint64)                                    {}
   146  func (nc *NoopCollector) LatestTrieRegSizeDiff(size int64)                                 {}
   147  func (nc *NoopCollector) LatestTrieMaxDepthTouched(maxDepth uint16)                        {}
   148  func (nc *NoopCollector) UpdateCount()                                                     {}
   149  func (nc *NoopCollector) ProofSize(bytes uint32)                                           {}
   150  func (nc *NoopCollector) UpdateValuesNumber(number uint64)                                 {}
   151  func (nc *NoopCollector) UpdateValuesSize(byte uint64)                                     {}
   152  func (nc *NoopCollector) UpdateDuration(duration time.Duration)                            {}
   153  func (nc *NoopCollector) UpdateDurationPerItem(duration time.Duration)                     {}
   154  func (nc *NoopCollector) ReadValuesNumber(number uint64)                                   {}
   155  func (nc *NoopCollector) ReadValuesSize(byte uint64)                                       {}
   156  func (nc *NoopCollector) ReadDuration(duration time.Duration)                              {}
   157  func (nc *NoopCollector) ReadDurationPerItem(duration time.Duration)                       {}
   158  func (nc *NoopCollector) ExecutionCollectionRequestSent()                                  {}
   159  func (nc *NoopCollector) ExecutionCollectionRequestRetried()                               {}
   160  func (nc *NoopCollector) RuntimeTransactionParsed(dur time.Duration)                       {}
   161  func (nc *NoopCollector) RuntimeTransactionChecked(dur time.Duration)                      {}
   162  func (nc *NoopCollector) RuntimeTransactionInterpreted(dur time.Duration)                  {}
   163  func (nc *NoopCollector) RuntimeSetNumberOfAccounts(count uint64)                          {}
   164  func (nc *NoopCollector) ScriptExecuted(dur time.Duration, size int)                       {}
   165  func (nc *NoopCollector) TransactionResultFetched(dur time.Duration, size int)             {}
   166  func (nc *NoopCollector) TransactionReceived(txID flow.Identifier, when time.Time)         {}
   167  func (nc *NoopCollector) TransactionFinalized(txID flow.Identifier, when time.Time)        {}
   168  func (nc *NoopCollector) TransactionExecuted(txID flow.Identifier, when time.Time)         {}
   169  func (nc *NoopCollector) TransactionExpired(txID flow.Identifier)                          {}
   170  func (nc *NoopCollector) TransactionSubmissionFailed()                                     {}
   171  func (nc *NoopCollector) UpdateExecutionReceiptMaxHeight(height uint64)                    {}
   172  func (nc *NoopCollector) ChunkDataPackRequestProcessed()                                   {}
   173  func (nc *NoopCollector) ExecutionSync(syncing bool)                                       {}
   174  func (nc *NoopCollector) ExecutionBlockDataUploadStarted()                                 {}
   175  func (nc *NoopCollector) ExecutionBlockDataUploadFinished(dur time.Duration)               {}
   176  func (nc *NoopCollector) ExecutionComputationResultUploaded()                              {}
   177  func (nc *NoopCollector) ExecutionComputationResultUploadRetried()                         {}
   178  func (nc *NoopCollector) RootIDComputed(duration time.Duration, numberOfChunks int)        {}
   179  func (nc *NoopCollector) AddBlobsSucceeded(duration time.Duration, totalSize uint64)       {}
   180  func (nc *NoopCollector) AddBlobsFailed()                                                  {}
   181  func (nc *NoopCollector) FulfilledHeight(blockHeight uint64)                               {}
   182  func (nc *NoopCollector) ReceiptSkipped()                                                  {}
   183  func (nc *NoopCollector) RequestSucceeded(blockHeight uint64, duration time.Duration, totalSize uint64, numberOfAttempts int) {
   184  }
   185  func (nc *NoopCollector) RequestFailed(duration time.Duration, retryable bool)                  {}
   186  func (nc *NoopCollector) RequestCanceled()                                                      {}
   187  func (nc *NoopCollector) ResponseDropped()                                                      {}
   188  func (nc *NoopCollector) Pruned(height uint64, duration time.Duration)                          {}
   189  func (nc *NoopCollector) UpdateCollectionMaxHeight(height uint64)                               {}
   190  func (nc *NoopCollector) BucketAvailableSlots(uint64, uint64)                                   {}
   191  func (nc *NoopCollector) OnKeyPutSuccess(uint32)                                                {}
   192  func (nc *NoopCollector) OnEntityEjectionDueToFullCapacity()                                    {}
   193  func (nc *NoopCollector) OnEntityEjectionDueToEmergency()                                       {}
   194  func (nc *NoopCollector) OnKeyGetSuccess()                                                      {}
   195  func (nc *NoopCollector) OnKeyGetFailure()                                                      {}
   196  func (nc *NoopCollector) OnKeyPutAttempt(uint32)                                                {}
   197  func (nc *NoopCollector) OnKeyPutDrop()                                                         {}
   198  func (nc *NoopCollector) OnKeyPutDeduplicated()                                                 {}
   199  func (nc *NoopCollector) OnKeyRemoved(uint32)                                                   {}
   200  func (nc *NoopCollector) ExecutionDataFetchStarted()                                            {}
   201  func (nc *NoopCollector) ExecutionDataFetchFinished(_ time.Duration, _ bool, _ uint64)          {}
   202  func (nc *NoopCollector) NotificationSent(height uint64)                                        {}
   203  func (nc *NoopCollector) FetchRetried()                                                         {}
   204  func (nc *NoopCollector) RoutingTablePeerAdded()                                                {}
   205  func (nc *NoopCollector) RoutingTablePeerRemoved()                                              {}
   206  func (nc *NoopCollector) PrunedBlockById(status *chainsync.Status)                              {}
   207  func (nc *NoopCollector) PrunedBlockByHeight(status *chainsync.Status)                          {}
   208  func (nc *NoopCollector) PrunedBlocks(totalByHeight, totalById, storedByHeight, storedById int) {}
   209  func (nc *NoopCollector) RangeRequested(ran chainsync.Range)                                    {}
   210  func (nc *NoopCollector) BatchRequested(batch chainsync.Batch)                                  {}
   211  func (nc *NoopCollector) OnUnauthorizedMessage(role, msgType, topic, offense string)            {}
   212  func (nc *NoopCollector) OnRateLimitedUnicastMessage(role, msgType, topic, reason string)       {}
   213  func (nc *NoopCollector) OnIWantReceived(int)                                                   {}
   214  func (nc *NoopCollector) OnIHaveReceived(int)                                                   {}
   215  func (nc *NoopCollector) OnGraftReceived(int)                                                   {}
   216  func (nc *NoopCollector) OnPruneReceived(int)                                                   {}
   217  func (nc *NoopCollector) OnIncomingRpcAcceptedFully()                                           {}
   218  func (nc *NoopCollector) OnIncomingRpcAcceptedOnlyForControlMessages()                          {}
   219  func (nc *NoopCollector) OnIncomingRpcRejected()                                                {}
   220  func (nc *NoopCollector) OnPublishedGossipMessagesReceived(count int)                           {}
   221  func (nc *NoopCollector) AllowConn(dir network.Direction, usefd bool)                           {}
   222  func (nc *NoopCollector) BlockConn(dir network.Direction, usefd bool)                           {}
   223  func (nc *NoopCollector) AllowStream(p peer.ID, dir network.Direction)                          {}
   224  func (nc *NoopCollector) BlockStream(p peer.ID, dir network.Direction)                          {}
   225  func (nc *NoopCollector) AllowPeer(p peer.ID)                                                   {}
   226  func (nc *NoopCollector) BlockPeer(p peer.ID)                                                   {}
   227  func (nc *NoopCollector) AllowProtocol(proto protocol.ID)                                       {}
   228  func (nc *NoopCollector) BlockProtocol(proto protocol.ID)                                       {}
   229  func (nc *NoopCollector) BlockProtocolPeer(proto protocol.ID, p peer.ID)                        {}
   230  func (nc *NoopCollector) AllowService(svc string)                                               {}
   231  func (nc *NoopCollector) BlockService(svc string)                                               {}
   232  func (nc *NoopCollector) BlockServicePeer(svc string, p peer.ID)                                {}
   233  func (nc *NoopCollector) AllowMemory(size int)                                                  {}
   234  func (nc *NoopCollector) BlockMemory(size int)                                                  {}
   235  
   236  var _ module.HeroCacheMetrics = (*NoopCollector)(nil)
   237  var _ module.NetworkMetrics = (*NoopCollector)(nil)
   238  
   239  func NewNoopCollector() *NoopCollector {
   240  	nc := &NoopCollector{}
   241  	return nc
   242  }