Skip to content

Commit

Permalink
chore(taiko-client): add more metrics for TxBuilderWithFallback (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Jan 6, 2025
1 parent 6fb1fd2 commit b62d390
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/taiko-client/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
ProposerPoolContentFetchTime = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_pool_content_fetch_time"})
ProposerEstimatedCostCalldata = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_calldata"})
ProposerEstimatedCostBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_blob"})
ProposerProposeByCalldata = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_calldata"})
ProposerProposeByBlob = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_blob"})

// Prover
ProverLatestVerifiedIDGauge = factory.NewGauge(prometheus.GaugeOpts{Name: "prover_latestVerified_id"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ func (b *TxBuilderWithFallback) BuildOntake(

if costCalldata.Cmp(costBlob) < 0 {
log.Info("Building a type-2 transaction", "costCalldata", costCalldata, "costBlob", costBlob)
metrics.ProposerProposeByCalldata.Inc()
return txWithCalldata, nil
}

log.Info("Building a type-3 transaction", "costCalldata", costCalldata, "costBlob", costBlob)
metrics.ProposerProposeByBlob.Inc()
return txWithBlob, nil
}

Expand Down

0 comments on commit b62d390

Please sign in to comment.