From 44740fe5d09e0ff6f39a2feb49252effd27e98c3 Mon Sep 17 00:00:00 2001 From: Po Bera Date: Fri, 19 Jan 2024 13:49:14 -0500 Subject: [PATCH] remove Stats --- cosmos/runtime/txpool/handler.go | 4 ---- cosmos/runtime/txpool/mempool.go | 5 ----- cosmos/runtime/txpool/mocks/tx_sub_provider.go | 4 ---- 3 files changed, 13 deletions(-) diff --git a/cosmos/runtime/txpool/handler.go b/cosmos/runtime/txpool/handler.go index 3502c4acc..e034944b4 100644 --- a/cosmos/runtime/txpool/handler.go +++ b/cosmos/runtime/txpool/handler.go @@ -52,7 +52,6 @@ type SdkTx interface { // TxSubProvider. type TxSubProvider interface { SubscribeTransactions(ch chan<- core.NewTxsEvent, reorgs bool) event.Subscription - Stats() (int, int) } // TxSerializer provides an interface to Serialize Geth Transactions to Bytes (via sdk.Tx). @@ -153,9 +152,6 @@ func (h *handler) mainLoop() { case err = <-h.txsSub.Err(): h.stopCh <- struct{}{} case event := <-h.txsCh: - pending, queue := h.txPool.Stats() - telemetry.SetGauge(float32(pending), MetricKeyTxPoolPending) - telemetry.SetGauge(float32(queue), MetricKeyTxPoolQueue) telemetry.IncrCounter(float32(len(event.Txs)), MetricKeyCometLocalTxs) h.broadcastTransactions(event.Txs) } diff --git a/cosmos/runtime/txpool/mempool.go b/cosmos/runtime/txpool/mempool.go index 4f1ede133..ecf582eb1 100644 --- a/cosmos/runtime/txpool/mempool.go +++ b/cosmos/runtime/txpool/mempool.go @@ -108,10 +108,6 @@ func (m *Mempool) Stop() error { // Insert attempts to insert a Tx into the app-side mempool returning an error upon failure. func (m *Mempool) Insert(ctx context.Context, sdkTx sdk.Tx) error { - txPoolPending, txPoolQueue := m.TxPool.Stats() - telemetry.SetGauge(float32(txPoolPending), MetricKeyTxPoolPending) - telemetry.SetGauge(float32(txPoolQueue), MetricKeyTxPoolQueue) - sCtx := sdk.UnwrapSDKContext(ctx) msgs := sdkTx.GetMsgs() if len(msgs) != 1 { @@ -130,7 +126,6 @@ func (m *Mempool) Insert(ctx context.Context, sdkTx sdk.Tx) error { // Insert the tx into the txpool as a remote. m.blockBuilderMu.RLock() errs := m.TxPool.Add([]*ethtypes.Transaction{ethTx}, false, false) - telemetry.SetGauge(float32(m.CountTx()), MetricKeyMempoolSize) m.blockBuilderMu.RUnlock() if len(errs) > 0 { // Handle case where a node broadcasts to itself, we don't want it to fail CheckTx. diff --git a/cosmos/runtime/txpool/mocks/tx_sub_provider.go b/cosmos/runtime/txpool/mocks/tx_sub_provider.go index 5941390ca..379478103 100644 --- a/cosmos/runtime/txpool/mocks/tx_sub_provider.go +++ b/cosmos/runtime/txpool/mocks/tx_sub_provider.go @@ -42,10 +42,6 @@ func (_m *TxSubProvider) SubscribeTransactions(ch chan<- core.NewTxsEvent, reorg return r0 } -func (_m *TxSubProvider) Stats() (int, int) { - return 0, 0 -} - // TxSubProvider_SubscribeTransactions_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubscribeTransactions' type TxSubProvider_SubscribeTransactions_Call struct { *mock.Call