Skip to content

Commit

Permalink
πŸ‘Œ log the message if loadEventEnd is > 1day
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitZugmeyer committed Dec 20, 2019
1 parent 9f1d132 commit 843cda3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/rum/src/performanceCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ function reportAbnormalTimeOrigin() {
if (typeof performance.timeOrigin !== 'number') {
return
}
const diff = Math.abs(performance.timing.navigationStart - performance.timeOrigin)
if (diff > 86400e3 /* 1 day in ms */) {
if (getRelativeTime(performance.timing.loadEventEnd) > 86400e3 /* 1 day in ms */) {
addMonitoringMessage(
`Got a big diff between navigationStart and timeOrigin
`Got an abnormal loadEventEnd timing
Session Id: ${viewContext.sessionId}
View Id: ${viewContext.id}
timeOrigin: ${performance.timeOrigin}
navigationStart: ${performance.timing.navigationStart}
diff: ${diff}`
loadEventEnd: ${performance.timing.loadEventEnd}
timing: ${getRelativeTime(performance.timing.loadEventEnd)}`
)
}
}
Expand Down

0 comments on commit 843cda3

Please sign in to comment.