Skip to content

Commit

Permalink
dont log plugin message queue when plugin processing takes too long
Browse files Browse the repository at this point in the history
Summary:
While profiling the bloks debugger i noticed that in the heap snapshot the largest strings were these log messages. this is because we log the entire message queue which can be enormous.

this creates a negative feedback loop in that the giant string adds additional memory pressure.

Reviewed By: passy

Differential Revision: D64105989

fbshipit-source-id: 495913ae886196825a1c949b6b3980f56c241cee
  • Loading branch information
Luke De Feo authored and facebook-github-bot committed Oct 10, 2024
1 parent 1d91d76 commit 45ea3c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions desktop/flipper-ui/src/utils/pluginStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export function addBackgroundStat(
stat.maxTime = Math.max(stat.maxTime, cpuTime);
if (cpuTime > MAX_BACKGROUND_TASK_TIME) {
console.warn(
`Plugin ${plugin} took too much time while doing background: ${cpuTime}ms. Handling background messages should take less than ${MAX_BACKGROUND_TASK_TIME}ms.`,
messages,
`Plugin ${plugin} took too much time while doing background: ${cpuTime}ms. Handling background messages should take less than ${MAX_BACKGROUND_TASK_TIME}ms. message queue length`,
messages.length,
);
}
}

0 comments on commit 45ea3c5

Please sign in to comment.