MCPcopy Create free account
hub / github.com/plotly/dash / recordProfile

Function recordProfile

dash/dash-renderer/src/actions/callbacks.ts:544–579  ·  view source on GitHub ↗
(result: any)

Source from the content-addressed store, hash-verified

542 }
543
544 function recordProfile(result: any) {
545 if (config.ui) {
546 // Callback profiling - only relevant if we're showing the debug ui
547 const resources = {
548 __dash_server: 0,
549 __dash_client: Date.now() - requestTime,
550 __dash_upload: body.length,
551 __dash_download: Number(
552 res.headers.get('Content-Length')
553 )
554 } as any;
555
556 const timingHeaders =
557 res.headers.get('Server-Timing') || '';
558
559 timingHeaders.split(',').forEach((header: any) => {
560 const name = header.split(';')[0];
561 const dur = header.match(/;dur=[0-9.]+/);
562
563 if (dur) {
564 resources[name] = Number(dur[0].slice(5));
565 }
566 });
567
568 dispatch(
569 updateResourceUsage({
570 id: payload.output,
571 usage: resources,
572 status,
573 result,
574 inputs: payload.inputs,
575 state: payload.state
576 })
577 );
578 }
579 }
580
581 const finishLine = (data: CallbackResponseData) => {
582 const {multi, response} = data;

Callers 2

finishLineFunction · 0.85
handleOutputFunction · 0.85

Calls 2

getMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…