Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 committed Oct 31, 2024
1 parent 6fcd4fc commit b418874
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/performance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class TracePerf {
service: options.service,
}
this.coreWebMetrics = new Proxy({...this.perfInfo, collector: options.collector, useWebVitals: options.useWebVitals}, handler);
// this.observeResources();
this.observeResources();
// trace and report perf data and pv to serve when page loaded
if (document.readyState === 'complete') {
this.getBasicPerf();
} else {
window.addEventListener('load', this.getBasicPerf);
window.addEventListener('load', () => this.getBasicPerf());
}
this.getCorePerf();
// window.addEventListener('beforeunload', this.reportResources);
window.addEventListener('beforeunload', () => this.reportResources);
}
private observeResources() {
observe('resource', (list) => {
Expand Down

0 comments on commit b418874

Please sign in to comment.