Skip to content

Commit

Permalink
🔊 [RUM-257] add more abnormal info (#248)
Browse files Browse the repository at this point in the history
* 🔊 add page start date

* 🔊 add previous navigation entries
  • Loading branch information
bcaudan authored Feb 4, 2020
1 parent 1bfa21c commit 765efce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/rum/src/viewTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ interface ViewContext {
export let viewContext: ViewContext

const THROTTLE_VIEW_UPDATE_PERIOD = 3000
const pageOrigin = Date.now()
const navigationEntries: PerformanceNavigationTiming[] = []
let startTimestamp: number
let startOrigin: number
let documentVersion: number
Expand Down Expand Up @@ -128,11 +130,13 @@ function reportAbnormalLoadEvent(navigationEntry: PerformanceNavigationTiming) {
Session Id: ${viewContext.sessionId}
View Id: ${viewContext.id}
Load event: ${navigationEntry.loadEventEnd}
Page start date: ${pageOrigin}
View start date: ${startTimestamp}
Page duration: ${performance.now()}
View duration: ${performance.now() - startOrigin}
Document Version: ${documentVersion}
Entry: ${JSON.stringify(navigationEntry)}
Previous navigation entries: ${JSON.stringify(navigationEntries)}
Perf timing: ${JSON.stringify(performance.timing)}
Previous measures: ${JSON.stringify(viewMeasures)}`
)
Expand All @@ -152,6 +156,7 @@ function trackMeasures(lifeCycle: LifeCycle, scheduleViewUpdate: () => void) {
loadEventEnd: msToNs(navigationEntry.loadEventEnd),
}
scheduleViewUpdate()
navigationEntries.push(navigationEntry)
} else if (entry.entryType === 'paint' && entry.name === 'first-contentful-paint') {
const paintEntry = entry as PerformancePaintTiming
viewMeasures = {
Expand Down

0 comments on commit 765efce

Please sign in to comment.