From 63f1bda94c1baac642166772262cf34500dc9c32 Mon Sep 17 00:00:00 2001 From: Alex Gherghisan Date: Mon, 9 Dec 2024 09:22:24 +0000 Subject: [PATCH] fix: sequencer negative histogram recodings --- yarn-project/sequencer-client/src/sequencer/sequencer.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index d1bd7d3df1d..89d4fe2c313 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -385,7 +385,6 @@ export class Sequencer { } const bufferSeconds = this.timeTable[proposedState] - secondsIntoSlot; - this.metrics.recordStateTransitionBufferMs(bufferSeconds * 1000, proposedState); if (bufferSeconds < 0) { this.log.warn( @@ -393,6 +392,9 @@ export class Sequencer { ); return false; } + + this.metrics.recordStateTransitionBufferMs(Math.floor(bufferSeconds * 1000), proposedState); + this.log.debug( `Enough time to transition to ${proposedState}, max allowed: ${this.timeTable[proposedState]}s, time into slot: ${secondsIntoSlot}s`, );