|
65 | 65 | PeerCount uint64
|
66 | 66 | GasPrice *big.Int
|
67 | 67 | PendingCount uint64
|
| 68 | + QueuedCount uint64 |
68 | 69 | SelectedBlock rpctypes.PolyBlock
|
69 | 70 | SelectedTransaction rpctypes.PolyTransaction
|
70 | 71 | BlockCache *lru.Cache `json:"-"`
|
|
76 | 77 | PeerCount uint64
|
77 | 78 | GasPrice *big.Int
|
78 | 79 | PendingCount uint64
|
| 80 | + QueuedCount uint64 |
79 | 81 | }
|
80 | 82 | historicalDataPoint struct {
|
81 | 83 | SampleTime time.Time
|
@@ -119,6 +121,7 @@ func monitor(ctx context.Context) error {
|
119 | 121 |
|
120 | 122 | ms.ChainID = big.NewInt(0)
|
121 | 123 | ms.PendingCount = 0
|
| 124 | + ms.QueuedCount = 0 |
122 | 125 |
|
123 | 126 | observedPendingTxs = make(historicalRange, 0)
|
124 | 127 |
|
@@ -182,10 +185,9 @@ func getChainState(ctx context.Context, ec *ethclient.Client) (*chainState, erro
|
182 | 185 | return nil, fmt.Errorf("couldn't estimate gas: %s", err.Error())
|
183 | 186 | }
|
184 | 187 |
|
185 |
| - cs.PendingCount, err = util.GetTxPoolSize(ec.Client()) |
| 188 | + cs.PendingCount, cs.QueuedCount, err = util.GetTxPoolStatus(ec.Client()) |
186 | 189 | if err != nil {
|
187 |
| - log.Debug().Err(err).Msg("Unable to get pending transaction count") |
188 |
| - cs.PendingCount = 0 |
| 190 | + log.Debug().Err(err).Msg("Unable to get pending and queued transaction count") |
189 | 191 | }
|
190 | 192 |
|
191 | 193 | return cs, nil
|
@@ -229,6 +231,7 @@ func fetchCurrentBlockData(ctx context.Context, ec *ethclient.Client, ms *monito
|
229 | 231 | ms.PeerCount = cs.PeerCount
|
230 | 232 | ms.GasPrice = cs.GasPrice
|
231 | 233 | ms.PendingCount = cs.PendingCount
|
| 234 | + ms.QueuedCount = cs.QueuedCount |
232 | 235 |
|
233 | 236 | return
|
234 | 237 | }
|
@@ -432,6 +435,7 @@ func renderMonitorUI(ctx context.Context, ec *ethclient.Client, ms *monitorStatu
|
432 | 435 | Uint64("PeerCount", ms.PeerCount).
|
433 | 436 | Str("GasPrice", ms.GasPrice.String()).
|
434 | 437 | Uint64("PendingCount", ms.PendingCount).
|
| 438 | + Uint64("QueuedCount", ms.QueuedCount). |
435 | 439 | Msg("Redrawing")
|
436 | 440 |
|
437 | 441 | if blockTable.SelectedRow == 0 {
|
@@ -464,7 +468,7 @@ func renderMonitorUI(ctx context.Context, ec *ethclient.Client, ms *monitorStatu
|
464 | 468 | renderedBlocks = renderedBlocksTemp
|
465 | 469 |
|
466 | 470 | log.Debug().Int("skeleton.Current.Inner.Dy()", skeleton.Current.Inner.Dy()).Int("skeleton.Current.Inner.Dx()", skeleton.Current.Inner.Dx()).Msg("the dimension of the current box")
|
467 |
| - skeleton.Current.Text = ui.GetCurrentBlockInfo(ms.HeadBlock, ms.GasPrice, ms.PeerCount, ms.PendingCount, ms.ChainID, renderedBlocks, skeleton.Current.Inner.Dx(), skeleton.Current.Inner.Dy()) |
| 471 | + skeleton.Current.Text = ui.GetCurrentBlockInfo(ms.HeadBlock, ms.GasPrice, ms.PeerCount, ms.PendingCount, ms.QueuedCount, ms.ChainID, renderedBlocks, skeleton.Current.Inner.Dx(), skeleton.Current.Inner.Dy()) |
468 | 472 | skeleton.TxPerBlockChart.Data = metrics.GetTxsPerBlock(renderedBlocks)
|
469 | 473 | skeleton.GasPriceChart.Data = metrics.GetMeanGasPricePerBlock(renderedBlocks)
|
470 | 474 | skeleton.BlockSizeChart.Data = metrics.GetSizePerBlock(renderedBlocks)
|
|
0 commit comments