Skip to content

Commit

Permalink
fix: updated contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Alok committed Apr 19, 2024
1 parent 1f095aa commit d17bc3a
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions pkg/transactor/metrics.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package transactor

import "github.com/prometheus/client_golang/prometheus"

const (
defaultNamespace = "mev_commit_oracle"
subsystem = "settler"
)

type metrics struct {
LastConfirmedNonce prometheus.Gauge
LastUsedNonce prometheus.Gauge
LastSentNonce prometheus.Gauge
LastConfirmedBlock prometheus.Gauge
}

func newMetrics() *metrics {
m := &metrics{}
m.LastConfirmedNonce = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: defaultNamespace,
Subsystem: subsystem,
Name: "last_confirmed_nonce",
Help: "Last confirmed nonce",
},
)
m.LastUsedNonce = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: defaultNamespace,
Subsystem: subsystem,
Name: "last_used_nonce",
Help: "Last used nonce",
},
)
m.LastConfirmedBlock = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: defaultNamespace,
Subsystem: subsystem,
Name: "last_confirmed_block",
Help: "Last confirmed block",
},
)
m.LastSentNonce = prometheus.NewGauge(
prometheus.GaugeOpts{
Namespace: defaultNamespace,
Subsystem: subsystem,
Name: "last_sent_nonce",
Help: "Last sent nonce",
},
)
return m
}

func (m *metrics) Collectors() []prometheus.Collector {
return []prometheus.Collector{
m.LastConfirmedNonce,
m.LastUsedNonce,
m.LastConfirmedBlock,
m.LastSentNonce,
}
}

0 comments on commit d17bc3a

Please sign in to comment.