Drk*_*ima 3 devtools performance-testing google-chrome-devtools
我在Chrome DevTools中大量使用了性能时间表来捕获页面的性能记录。
大多数情况下,我使用“开始配置和重新加载页面”,该页面会自动开始和停止记录。
问题是:DevTools何时决定停止记录?
我注意到,它总是继续在“加载”事件之后至少记录几百毫秒,并试图找出页面何时变为“大部分空闲”。
但这是一个模糊的猜测。我想知道它是否依赖于某些表演事件(例如在Lighthouse中的“互动时间”中使用的那个事件)?
目前,它等待的三个秒后load事件。
没有记录,因此将来可能会更改,恕不另行通知。
this._millisecondsToRecordAfterLoadEvent = 3000;
Run Code Online (Sandbox Code Playgroud)
async _loadEventFired(event) {
if (this._state !== Timeline.TimelinePanel.State.Recording || !this._recordingPageReload ||
this._controller.mainTarget() !== event.data.resourceTreeModel.target())
return;
const controller = this._controller;
await new Promise(r => setTimeout(r, this._millisecondsToRecordAfterLoadEvent));
// Check if we're still in the same recording session.
if (controller !== this._controller || this._state !== Timeline.TimelinePanel.State.Recording)
return;
this._stopRecording();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
106 次 |
| 最近记录: |