Skip to content

Commit

Permalink
Merge pull request #6624 from AndriiDiachuk/time-to-seal-metrics-fix
Browse files Browse the repository at this point in the history
Fixed issues where time-to-seal was NaN
  • Loading branch information
peterargue authored Nov 8, 2024
2 parents aaaf9be + 0ac69c1 commit acbc34f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions module/metrics/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -302,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) {
Expand Down

0 comments on commit acbc34f

Please sign in to comment.