Skip to content

Commit

Permalink
feat(window.loaded): Add new metric. (jitsi#14965)
Browse files Browse the repository at this point in the history
  • Loading branch information
hristoterezov authored Aug 1, 2024
1 parent e31aff5 commit 4d79bbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@

window.indexLoadedTime = window.performance.now();
console.log("(TIME) index.html loaded:\t", indexLoadedTime);
window.addEventListener('load', function() {
window.loadedEventTime = window.performance.now();
console.log("(TIME) window loaded event:\t", loadedEventTime);
});

// XXX the code below listeners for errors and displays an error message
// in the document body when any of the required files fails to load.
// The intention is to prevent from displaying broken page.
Expand Down
4 changes: 4 additions & 0 deletions react/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ globalNS.connectionTimes = {
'index.loaded': window.indexLoadedTime
};

window.addEventListener('load', () => {
globalNS.connectionTimes['window.loaded'] = window.loadedEventTime;
});

document.addEventListener('DOMContentLoaded', () => {
const now = window.performance.now();

Expand Down

0 comments on commit 4d79bbb

Please # to comment.