Skip to content

Commit

Permalink
feat!: capture all W3C fields in NavigationEvents (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
williazz committed Jul 16, 2024
1 parent a440016 commit 0ae8db5
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 513 deletions.
1 change: 0 additions & 1 deletion src/event-cache/__tests__/EventCache.integ.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ describe('EventCache tests', () => {
allowCookies: false,
sessionLengthSeconds: 0,
sessionAttributes: {
version: '2.0.0',
domain: 'overridden.console.aws.amazon.com',
browserLanguage: 'en-UK',
browserName: 'Chrome',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,38 @@
{
"$id": "com.amazon.rum.performance_navigation_event",
"$id": "com.amazon.rum.performance_navigation_timing",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "NavigationEvent",
"title": "PerformanceNavigationTimingEvent",
"type": "object",
"properties": {
"version": {
"const": "1.0.0",
"type": "string",
"description": "Schema version."
},
"initiatorType": {
"type": "string",
"enum": ["navigation", "route_change"]
"name": {
"type": "string"
},
"navigationType": {
"description": "An unsigned short which indicates how the navigation to this page was done. Possible values are:TYPE_NAVIGATE (0), TYPE_RELOAD (1), TYPE_BACK_FORWARD (2), TYPE_RESERVED (255)",
"type": "string",
"enum": ["navigate", "reload", "back_forward", "reserved"]
"entryType": {
"const": "navigation",
"type": "string"
},
"startTime": {
"type": "number"
},
"unloadEventStart": {
"type": "number"
"type": "number",
"description": "StartTime value is always '0' for PerformanceNavigationTimingEvents created by the PerformanceAPI. However, non-W3C 'route_changes' created by RUM's polyfill for SinglePageApplications can have startTimes >= 0."
},
"promptForUnload": {
"duration": {
"type": "number"
},
"redirectCount": {
"type": "integer"
"initiatorType": {
"type": "string",
"enum": ["navigation", "route_change"],
"description": "InitiatorType value is always 'navigation' for PerformanceNavigationTimingEvents created by the PerformanceAPI. However, RUM adds the non-W3C concept 'route_change' as a polyfill because the PerformanceAPI currently does not support Single Page Applications."
},
"redirectStart": {
"type": "number"
"nextHopProtocol": {
"type": "string"
},
"redirectTime": {
"workerStart": {
"type": "number"
},
"workerStart": {
"redirectStart": {
"type": "number"
},
"workerTime": {
"redirectEnd": {
"type": "number"
},
"fetchStart": {
Expand All @@ -48,73 +41,68 @@
"domainLookupStart": {
"type": "number"
},
"dns": {
"domainLookupEnd": {
"type": "number"
},
"nextHopProtocol": {
"type": "string"
},
"connectStart": {
"type": "number"
},
"connect": {
"connectEnd": {
"type": "number"
},
"secureConnectionStart": {
"type": "number"
},
"tlsTime": {
"type": "number"
},
"requestStart": {
"type": "number"
},
"timeToFirstByte": {
"type": "number"
},
"responseStart": {
"type": "number"
},
"responseTime": {
"responseEnd": {
"type": "number"
},
"domInteractive": {
"transferSize": {
"type": "number"
},
"domContentLoadedEventStart": {
"encodedBodySize": {
"type": "number"
},
"domContentLoaded": {
"decodedBodySize": {
"type": "number"
},
"domComplete": {
"type": "number"
},
"domProcessingTime": {
"domContentLoadedEventEnd": {
"type": "number"
},
"loadEventStart": {
"domContentLoadedEventStart": {
"type": "number"
},
"loadEventTime": {
"domInteractive": {
"type": "number"
},
"duration": {
"loadEventEnd": {
"type": "number"
},
"headerSize": {
"loadEventStart": {
"type": "number"
},
"transferSize": {
"type": "number"
"redirectCount": {
"type": "integer"
},
"compressionRatio": {
"type": {
"type": "string",
"enum": ["navigate", "reload", "back_forward", "prerender"]
},
"unloadEventEnd": {
"type": "number"
},
"navigationTimingLevel": {
"unloadEventStart": {
"type": "number"
}
},
"additionalProperties": false,
"required": ["version", "initiatorType", "startTime", "duration"]
"required": ["entryType", "startTime", "duration", "initiatorType"]
}
3 changes: 2 additions & 1 deletion src/orchestration/__tests__/Orchestration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ jest.mock('../../utils/common-utils', () => {
return {
__esModule: true,
...originalModule,
isLCPSupported: jest.fn().mockReturnValue(true)
isLCPSupported: jest.fn().mockReturnValue(true),
isNavigationSupported: jest.fn().mockReturnValue(true)
};
});

Expand Down
Loading

0 comments on commit 0ae8db5

Please sign in to comment.