Skip to content

Commit

Permalink
common: tweak timer logging
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerner committed Dec 26, 2024
1 parent a84b83b commit 5546056
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/indexer-common/src/sequential-timer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
)
}
Expand Down

0 comments on commit 5546056

Please sign in to comment.