Enhance a warning about taking too much time to process plugin messages

Summary:
Without seeing the specific messages it might be hard to debug what is taking so long.

CHANGELOG: Enhance a warning about taking too much time to process plugin messages

Differential Revision: D40340272

fbshipit-source-id: a4dbd639cf389763a3cb00a190216c0e653c08e4
This commit is contained in:
Andrey Goncharov
2022-10-13 03:40:51 -07:00
committed by Facebook GitHub Bot
parent b5a750935d
commit 1f78da881e
2 changed files with 12 additions and 2 deletions

View File

@@ -29,7 +29,11 @@ function processMessagesImmediately(
const reducerStartTime = Date.now();
try {
plugin.receiveMessages(messages);
addBackgroundStat(plugin.definition.id, Date.now() - reducerStartTime);
addBackgroundStat(
plugin.definition.id,
messages,
Date.now() - reducerStartTime,
);
} catch (e) {
console.error(
`Failed to process event for plugin ${plugin.definition.id}`,