Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
db7e112a
Unverified
Commit
db7e112a
authored
Apr 10, 2023
by
Joshua Gutow
Committed by
GitHub
Apr 10, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5409 from ethereum-optimism/jg/final_txmgr_metrics
txmgr: Fee metrics
parents
dca2cb63
03c7d949
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
tx_metrics.go
op-service/txmgr/metrics/tx_metrics.go
+20
-1
No files found.
op-service/txmgr/metrics/tx_metrics.go
View file @
db7e112a
...
@@ -19,7 +19,9 @@ type TxMetricer interface {
...
@@ -19,7 +19,9 @@ type TxMetricer interface {
type
TxMetrics
struct
{
type
TxMetrics
struct
{
TxL1GasFee
prometheus
.
Gauge
TxL1GasFee
prometheus
.
Gauge
txFees
prometheus
.
Counter
TxGasBump
prometheus
.
Gauge
TxGasBump
prometheus
.
Gauge
txFeeHistogram
prometheus
.
Histogram
LatencyConfirmedTx
prometheus
.
Gauge
LatencyConfirmedTx
prometheus
.
Gauge
currentNonce
prometheus
.
Gauge
currentNonce
prometheus
.
Gauge
txPublishError
*
prometheus
.
CounterVec
txPublishError
*
prometheus
.
CounterVec
...
@@ -49,6 +51,19 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
...
@@ -49,6 +51,19 @@ func MakeTxMetrics(ns string, factory metrics.Factory) TxMetrics {
Help
:
"L1 gas fee for transactions in GWEI"
,
Help
:
"L1 gas fee for transactions in GWEI"
,
Subsystem
:
"txmgr"
,
Subsystem
:
"txmgr"
,
}),
}),
txFees
:
factory
.
NewCounter
(
prometheus
.
CounterOpts
{
Namespace
:
ns
,
Name
:
"tx_fee_gwei_total"
,
Help
:
"Sum of fees spent for all transactions in GWEI"
,
Subsystem
:
"txmgr"
,
}),
txFeeHistogram
:
factory
.
NewHistogram
(
prometheus
.
HistogramOpts
{
Namespace
:
ns
,
Name
:
"tx_fee_histogram_gwei"
,
Help
:
"Tx Fee in GWEI"
,
Subsystem
:
"txmgr"
,
Buckets
:
[]
float64
{
0.5
,
1
,
2
,
5
,
10
,
20
,
40
,
60
,
80
,
100
,
200
,
400
,
800
,
1600
},
}),
TxGasBump
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
TxGasBump
:
factory
.
NewGauge
(
prometheus
.
GaugeOpts
{
Namespace
:
ns
,
Namespace
:
ns
,
Name
:
"tx_gas_bump"
,
Name
:
"tx_gas_bump"
,
...
@@ -90,8 +105,12 @@ func (t *TxMetrics) RecordNonce(nonce uint64) {
...
@@ -90,8 +105,12 @@ func (t *TxMetrics) RecordNonce(nonce uint64) {
// TxConfirmed records lots of information about the confirmed transaction
// TxConfirmed records lots of information about the confirmed transaction
func
(
t
*
TxMetrics
)
TxConfirmed
(
receipt
*
types
.
Receipt
)
{
func
(
t
*
TxMetrics
)
TxConfirmed
(
receipt
*
types
.
Receipt
)
{
fee
:=
float64
(
receipt
.
EffectiveGasPrice
.
Uint64
()
*
receipt
.
GasUsed
/
params
.
GWei
)
t
.
confirmEvent
.
Record
(
receiptStatusString
(
receipt
))
t
.
confirmEvent
.
Record
(
receiptStatusString
(
receipt
))
t
.
TxL1GasFee
.
Set
(
float64
(
receipt
.
EffectiveGasPrice
.
Uint64
()
*
receipt
.
GasUsed
/
params
.
GWei
))
t
.
TxL1GasFee
.
Set
(
fee
)
t
.
txFees
.
Add
(
fee
)
t
.
txFeeHistogram
.
Observe
(
fee
)
}
}
func
(
t
*
TxMetrics
)
RecordGasBumpCount
(
times
int
)
{
func
(
t
*
TxMetrics
)
RecordGasBumpCount
(
times
int
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment