From 554605673c54771199bf1a2c28cc566e4785a493 Mon Sep 17 00:00:00 2001 From: Daniel Werner Date: Thu, 26 Dec 2024 13:18:52 -0800 Subject: [PATCH] common: tweak timer logging --- packages/indexer-common/src/sequential-timer.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/indexer-common/src/sequential-timer.ts b/packages/indexer-common/src/sequential-timer.ts index 701cf36fa..9a50d4835 100644 --- a/packages/indexer-common/src/sequential-timer.ts +++ b/packages/indexer-common/src/sequential-timer.ts @@ -24,15 +24,16 @@ function logWorkTime( caller: string | undefined, milliseconds: number, ) { - const workTimeWarningThreshold = 1000 + const workTimeWarningThreshold = 5000 const workTime = Date.now() - workStarted - logger.debug(`timer loop took ${loopTime}ms workTime ${workTime} caller(${caller})`) - if (loopTime > milliseconds + workTimeWarningThreshold) { + if (workTime > milliseconds + workTimeWarningThreshold) { logger.warn( - 'timer work took longer than the sequential timer was configured for (+1s)', + 'timer work took longer than the sequential timer was configured for (>5s)', { loopTime, + workTime, milliseconds, + caller, }, ) }