Skip to content

Commit

Permalink
add bundle gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
unclezoro committed Aug 4, 2021
1 parent 465a3d2 commit dca85f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/tx_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ var (
queuedGauge = metrics.NewRegisteredGauge("txpool/queued", nil)
localGauge = metrics.NewRegisteredGauge("txpool/local", nil)
slotsGauge = metrics.NewRegisteredGauge("txpool/slots", nil)

bundleGauge = metrics.NewRegisteredGauge("txpool/bundles", nil)
)

// TxStatus is the current status of a transaction as seen by the pool.
Expand Down Expand Up @@ -562,6 +564,7 @@ func (pool *TxPool) MevBundles(blockNumber *big.Int, blockTimestamp uint64) ([]t
}

pool.mevBundles = bundles
bundleGauge.Update(int64(len(pool.mevBundles)))
return ret, nil
}

Expand Down Expand Up @@ -614,6 +617,7 @@ func (pool *TxPool) AddMevBundle(txs types.Transactions, maxBlockNumber *big.Int
delete(pool.mevBundles, leastBundleHash)
}
pool.mevBundles[hash] = &bundle
bundleGauge.Update(int64(len(pool.mevBundles)))
return hash, nil
}

Expand Down
1 change: 0 additions & 1 deletion internal/ethapi/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ type Backend interface {
TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions)
Bundles() []*types.MevBundle
GetBundleByHash(ctx context.Context, bundleHash common.Hash) *types.MevBundle
//GetBundleByHash(ctx context.Context, bundleHash common.Hash) *types.MevBundle
SubscribeNewTxsEvent(chan<- core.NewTxsEvent) event.Subscription

// Filter API
Expand Down

0 comments on commit dca85f8

Please sign in to comment.