MCPcopy
hub / github.com/react/react / logEvent

Function logEvent

packages/scheduler/src/SchedulerProfiling.js:34–57  ·  view source on GitHub ↗
(entries: Array<number | PriorityLevel>)

Source from the content-addressed store, hash-verified

32const SchedulerResumeEvent = 8;
33
34function logEvent(entries: Array<number | PriorityLevel>) {
35 if (eventLog !== null) {
36 const offset = eventLogIndex;
37 eventLogIndex += entries.length;
38 if (eventLogIndex + 1 > eventLogSize) {
39 eventLogSize *= 2;
40 if (eventLogSize > MAX_EVENT_LOG_SIZE) {
41 // Using console['error'] to evade Babel and ESLint
42 console['error'](
43 "Scheduler Profiling: Event log exceeded maximum size. Don't " +
44 'forget to call `stopLoggingProfilingEvents()`.',
45 );
46 stopLoggingProfilingEvents();
47 return;
48 }
49 const newEventLog = new Int32Array(eventLogSize * 4);
50 // $FlowFixMe[incompatible-call] found when upgrading Flow
51 newEventLog.set(eventLog);
52 eventLogBuffer = newEventLog.buffer;
53 eventLog = newEventLog;
54 }
55 eventLog.set(entries, offset);
56 }
57}
58
59export function startLoggingProfilingEvents(): void {
60 eventLogSize = INITIAL_EVENT_LOG_SIZE;

Callers 8

markTaskStartFunction · 0.70
markTaskCompletedFunction · 0.70
markTaskCanceledFunction · 0.70
markTaskErroredFunction · 0.70
markTaskRunFunction · 0.70
markTaskYieldFunction · 0.70
markSchedulerSuspendedFunction · 0.70
markSchedulerUnsuspendedFunction · 0.70

Calls 2

setMethod · 0.80

Tested by

no test coverage detected