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 lastwindowMsWhen it reports
commitsPerSec > commitsPerSecThresholdORrenderMsPerSec > renderMsPerSecThresholdminCommitscommits within the windowcooldownMsTelemetry
{ id, commitsPerSec, renderMsPerSec, commitsInWindow, reasons, windowMs, ... }telemetryActionName = "render_hotspot",telemetrySampleRate = 20telemetrySampleRate: 0Example
Example (force-enable in production, different thresholds)