Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new metrics for inbox #1909

Merged
merged 4 commits into from
Oct 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions arbnode/inbox_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/rlp"

"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/arbstate"
"github.com/offchainlabs/nitro/arbutil"
Expand All @@ -24,6 +26,11 @@ import (
"github.com/offchainlabs/nitro/util/containers"
)

var (
inboxLatestBatchGauge = metrics.NewRegisteredGauge("arb/inbox/latest/batch", nil)
inboxLatestBatchMessageGauge = metrics.NewRegisteredGauge("arb/inbox/latest/batch/message", nil)
)

type InboxTracker struct {
db ethdb.Database
txStreamer *TransactionStreamer
Expand Down Expand Up @@ -676,6 +683,8 @@ func (t *InboxTracker) AddSequencerBatches(ctx context.Context, client arbutil.L
"l1Block", latestL1Block,
"l1Timestamp", time.Unix(int64(latestTimestamp), 0),
)
inboxLatestBatchGauge.Update(int64(pos))
inboxLatestBatchMessageGauge.Update(int64(newMessageCount))

if t.validator != nil {
t.validator.ReorgToBatchCount(startPos)
Expand Down
Loading