MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / onInp

Function onInp

packages/browser-utils/src/metrics/webVitalSpans.ts:256–274  ·  view source on GitHub ↗
({ metric })

Source from the content-addressed store, hash-verified

254 }
255
256 const onInp: InstrumentationHandlerCallback = ({ metric }) => {
257 if (metric.value == null) {
258 return;
259 }
260
261 const duration = msToSec(metric.value);
262
263 if (duration > MAX_PLAUSIBLE_INP_DURATION) {
264 return;
265 }
266
267 const entry = metric.entries.find(e => e.duration === metric.value && INP_ENTRY_MAP[e.name]);
268
269 if (!entry) {
270 return;
271 }
272
273 _sendInpSpan(metric.value, entry);
274 };
275
276 addInpInstrumentationHandler(onInp);
277}

Callers

nothing calls this directly

Calls 2

msToSecFunction · 0.90
_sendInpSpanFunction · 0.85

Tested by

no test coverage detected