Skip to content

Commit

Permalink
feat(da): submitted batch size metric (#1020)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored Aug 15, 2024
1 parent 7ee8303 commit fd3cf3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ func (m *Manager) CreateAndSubmitBatch(maxSizeBytes uint64) (*types.Batch, error
return nil, fmt.Errorf("create batch: %w", err)
}

m.logger.Info("Created batch.", "start height", startHeight, "end height", endHeightInclusive)
m.logger.Info("Created batch.", "start height", startHeight, "end height", endHeightInclusive, "size", b.SizeBytes())
types.LastBatchSubmittedBytes.Set(float64(b.SizeBytes()))

if err := m.SubmitBatch(b); err != nil {
return nil, fmt.Errorf("submit batch: %w", err)
Expand Down
5 changes: 5 additions & 0 deletions types/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ var RollappPendingSubmissionsSkewNumBytes = promauto.NewGauge(prometheus.GaugeOp
Help: "The number of bytes (of blocks and commits) which have been accumulated but not yet submitted.",
})

var LastBatchSubmittedBytes = promauto.NewGauge(prometheus.GaugeOpts{
Name: "last_batch_submitted_bytes",
Help: "The size in bytes of the last batch submitted to DA.",
})

var LastReceivedP2PHeightGauge = promauto.NewGauge(prometheus.GaugeOpts{
Name: "last_received_p2p_height",
Help: "The height of the last block received from P2P.",
Expand Down

0 comments on commit fd3cf3c

Please sign in to comment.