Wraps a subtree in a React Profiler, tracks commit frequency and render cost in a sliding window,
and reports when thresholds are exceeded. Intended primarily for development; can be force-enabled
in production for targeted diagnostics.
What it measures
commits/sec over the last windowMs (default 2s)
render ms/sec (sum of actualDuration) over the last windowMs
When it reports
When commitsPerSec > commitsPerSecThreshold OR
When renderMsPerSec > renderMsPerSecThreshold
Only after at least minCommits commits within the window
At most once per cooldownMs
Telemetry
Sends a single DataDog action (sampled) per hotspot with:
{ id, commitsPerSec, renderMsPerSec, commitsInWindow, reasons, windowMs, ... }
RenderDetector
Wraps a subtree in a React Profiler, tracks commit frequency and render cost in a sliding window, and reports when thresholds are exceeded. Intended primarily for development; can be force-enabled in production for targeted diagnostics.
What it measures
windowMs
(default 2s)actualDuration
) over the lastwindowMs
When it reports
commitsPerSec > commitsPerSecThreshold
ORrenderMsPerSec > renderMsPerSecThreshold
minCommits
commits within the windowcooldownMs
Telemetry
{ id, commitsPerSec, renderMsPerSec, commitsInWindow, reasons, windowMs, ... }
telemetryActionName = "render_hotspot"
,telemetrySampleRate = 20
telemetrySampleRate: 0
Example
Example (force-enable in production, different thresholds)