record capture time
This commit is contained in:
parent
74439a8077
commit
59a5817f87
|
|
@ -408,6 +408,8 @@ export function frameSnapshotStreamer(snapshotStreamer: string, removeNoScript:
|
||||||
};
|
};
|
||||||
|
|
||||||
if (nodeName === 'CANVAS') {
|
if (nodeName === 'CANVAS') {
|
||||||
|
const start = performance.now();
|
||||||
|
|
||||||
const canvas = node as HTMLCanvasElement;
|
const canvas = node as HTMLCanvasElement;
|
||||||
const requestedMIME = 'image/webp';
|
const requestedMIME = 'image/webp';
|
||||||
const dataURL = canvas.toDataURL(requestedMIME);
|
const dataURL = canvas.toDataURL(requestedMIME);
|
||||||
|
|
@ -422,6 +424,9 @@ export function frameSnapshotStreamer(snapshotStreamer: string, removeNoScript:
|
||||||
this._capturedCanvases.add(sha);
|
this._capturedCanvases.add(sha);
|
||||||
canvasRenderResults[sha] = contentsB64;
|
canvasRenderResults[sha] = contentsB64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const duration = performance.now() - start;
|
||||||
|
attrs['__playwright_canvas_time_'] = duration + 'ms';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nodeType === Node.DOCUMENT_FRAGMENT_NODE)
|
if (nodeType === Node.DOCUMENT_FRAGMENT_NODE)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue