From 7fb02e2f1757470e96e018360922f87198b76b3e Mon Sep 17 00:00:00 2001 From: agnusmor Date: Thu, 29 Feb 2024 10:54:11 +0100 Subject: [PATCH 1/2] fix metrics estimatedTxsPerSec div --- sequencer/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer/metrics.go b/sequencer/metrics.go index e1a10bc029..5163e483bf 100644 --- a/sequencer/metrics.go +++ b/sequencer/metrics.go @@ -84,7 +84,7 @@ func (m *metrics) close(createdAt time.Time, txsCount int64) { // estimatedTxs is the number of transactions that we estimate could have been processed in the block estimatedTxs := float64(totalTime.Microseconds()-m.newL2BlockTimes.total().Microseconds()) / float64(timePerTxuS) // estimatedTxxPerSec is the estimated transactions per second - m.estimatedTxsPerSec = float64(totalTime.Microseconds()) / estimatedTxs + m.estimatedTxsPerSec = estimatedTxs / float64(totalTime.Seconds()) } } From e9e2e1baeab70ba614e908702b0f6d85dcb5ff3d Mon Sep 17 00:00:00 2001 From: agnusmor Date: Thu, 29 Feb 2024 10:56:08 +0100 Subject: [PATCH 2/2] remove unneeded cast --- sequencer/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer/metrics.go b/sequencer/metrics.go index 5163e483bf..ea39caa9ac 100644 --- a/sequencer/metrics.go +++ b/sequencer/metrics.go @@ -84,7 +84,7 @@ func (m *metrics) close(createdAt time.Time, txsCount int64) { // estimatedTxs is the number of transactions that we estimate could have been processed in the block estimatedTxs := float64(totalTime.Microseconds()-m.newL2BlockTimes.total().Microseconds()) / float64(timePerTxuS) // estimatedTxxPerSec is the estimated transactions per second - m.estimatedTxsPerSec = estimatedTxs / float64(totalTime.Seconds()) + m.estimatedTxsPerSec = estimatedTxs / totalTime.Seconds() } }