Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔊 [RUM-257] add more abnormal info #248

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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