From b0becd5d838ab48aa90d1ec5890f732557e551d7 Mon Sep 17 00:00:00 2001 From: Andrii Date: Thu, 7 Nov 2024 17:13:41 +0200 Subject: [PATCH 1/2] Fixed issues where time-to-seal was NaN --- module/metrics/transaction.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/module/metrics/transaction.go b/module/metrics/transaction.go index 474d1ba5fe1..a0f5bb0b497 100644 --- a/module/metrics/transaction.go +++ b/module/metrics/transaction.go @@ -258,11 +258,6 @@ func (tc *TransactionCollector) TransactionFinalized(txID flow.Identifier, when tc.trackTTF(t, tc.logTimeToFinalized) tc.trackTTFE(t, tc.logTimeToFinalizedExecuted) - - // remove transaction timing from mempool if finalized and executed - if !t.Finalized.IsZero() && !t.Executed.IsZero() { - tc.transactionTimings.Remove(txID) - } } func (tc *TransactionCollector) TransactionExecuted(txID flow.Identifier, when time.Time) { @@ -280,11 +275,6 @@ func (tc *TransactionCollector) TransactionExecuted(txID flow.Identifier, when t tc.trackTTE(t, tc.logTimeToExecuted) tc.trackTTFE(t, tc.logTimeToFinalizedExecuted) - - // remove transaction timing from mempool if finalized and executed - if !t.Finalized.IsZero() && !t.Executed.IsZero() { - tc.transactionTimings.Remove(txID) - } } func (tc *TransactionCollector) TransactionSealed(txID flow.Identifier, when time.Time) { From 40d5c3ef2a043ad484866a1a01accd248dc4dfe6 Mon Sep 17 00:00:00 2001 From: Andrii Date: Thu, 7 Nov 2024 18:35:12 +0200 Subject: [PATCH 2/2] Always remove record at the end --- module/metrics/transaction.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/module/metrics/transaction.go b/module/metrics/transaction.go index a0f5bb0b497..728083f8a84 100644 --- a/module/metrics/transaction.go +++ b/module/metrics/transaction.go @@ -292,10 +292,8 @@ func (tc *TransactionCollector) TransactionSealed(txID flow.Identifier, when tim tc.trackTTS(t, tc.logTimeToSealed) - // remove transaction timing from mempool if sealed - if !t.Sealed.IsZero() { - tc.transactionTimings.Remove(txID) - } + // remove transaction timing from mempool + tc.transactionTimings.Remove(txID) } func (tc *TransactionCollector) trackTTF(t *flow.TransactionTiming, log bool) {