Skip to content

Commit

Permalink
Merge pull request #2392 from DataDog/mconstantin/rum-7191/implement-…
Browse files Browse the repository at this point in the history
…basic-functionality-for-tns-metric

RUM-7191 Implemented the basic logic for time-to-network-settle view metric
  • Loading branch information
mariusc83 authored Nov 26, 2024
2 parents a67406e + f1e298b commit 39039d1
Show file tree
Hide file tree
Showing 24 changed files with 2,562 additions and 104 deletions.
3 changes: 3 additions & 0 deletions detekt_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ datadog:
# endregion
# region Java Collections
- "java.util.ArrayList.forEach(kotlin.Function1)"
- "java.util.HashSet.add(kotlin.String)"
- "java.util.HashSet.clear()"
- "java.util.HashSet.remove(kotlin.String)"
- "java.util.LinkedList.add(android.view.View)"
- "java.util.LinkedList.add(com.datadog.android.privacy.TrackingConsentProviderCallback)"
- "java.util.LinkedList.add(com.datadog.android.sessionreplay.internal.recorder.Node)"
Expand Down
289 changes: 284 additions & 5 deletions features/dd-sdk-android-rum/api/apiSurface

Large diffs are not rendered by default.

1,054 changes: 992 additions & 62 deletions features/dd-sdk-android-rum/api/dd-sdk-android-rum.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,11 @@
},
"service": {
"type": "string",
"description": "The service name for this application",
"readOnly": true
"description": "The service name for this application"
},
"version": {
"type": "string",
"description": "The version for this application",
"readOnly": true
"description": "The version for this application"
},
"build_version": {
"type": "string",
Expand Down
26 changes: 26 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/error-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,19 @@
},
"readOnly": true
},
"csp": {
"type": "object",
"description": "Content Security Violation properties",
"properties": {
"disposition": {
"type": "string",
"description": "In the context of CSP errors, indicates how the violated policy is configured to be treated by the user agent.",
"enum": ["enforce", "report"],
"readOnly": true
}
},
"readOnly": true
},
"time_since_app_start": {
"type": "integer",
"description": "Time since application start when error happened (in milliseconds)",
Expand All @@ -322,6 +335,19 @@
},
"readOnly": true
},
"freeze": {
"type": "object",
"description": "Properties of App Hang and ANR errors",
"required": ["duration"],
"properties": {
"duration": {
"type": "integer",
"description": "Duration of the main thread freeze (in ns)",
"readOnly": true
}
},
"readOnly": true
},
"view": {
"type": "object",
"description": "View properties",
Expand Down
119 changes: 117 additions & 2 deletions features/dd-sdk-android-rum/src/main/json/rum/long_task-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/long_task-schema.json",
"$comment": "Long animation frames are ingested as long tasks",
"title": "RumLongTaskEvent",
"type": "object",
"description": "Schema of all properties of a Long Task event",
Expand Down Expand Up @@ -30,20 +31,134 @@
"properties": {
"id": {
"type": "string",
"description": "UUID of the long task",
"description": "UUID of the long task or long animation frame",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"readOnly": true
},
"start_time": {
"type": "number",
"description": "Start time of the long animation frame",
"minimum": 0,
"readOnly": true
},
"entry_type": {
"type": "string",
"description": "Type of the event: long task or long animation frame",
"enum": ["long-task", "long-animation-frame"],
"readOnly": true
},
"duration": {
"type": "integer",
"description": "Duration in ns of the long task",
"description": "Duration in ns of the long task or long animation frame",
"minimum": 0,
"readOnly": true
},
"blocking_duration": {
"type": "integer",
"description": "Duration in ns for which the animation frame was being blocked",
"minimum": 0,
"readOnly": true
},
"render_start": {
"type": "number",
"description": "Start time of the rendering cycle, which includes requestAnimationFrame callbacks, style and layout calculation, resize observer and intersection observer callbacks",
"minimum": 0,
"readOnly": true
},
"style_and_layout_start": {
"type": "number",
"description": "Start time of the time period spent in style and layout calculations",
"minimum": 0,
"readOnly": true
},
"first_ui_event_timestamp": {
"type": "number",
"description": "Start time of of the first UI event (mouse/keyboard and so on) to be handled during the course of this frame",
"minimum": 0,
"readOnly": true
},
"is_frozen_frame": {
"type": "boolean",
"description": "Whether this long task is considered a frozen frame",
"readOnly": true
},
"scripts": {
"type": "array",
"description": "A list of long scripts that were executed over the course of the long frame",
"items": {
"type": "object",
"properties": {
"duration": {
"type": "integer",
"description": "Duration in ns between startTime and when the subsequent microtask queue has finished processing",
"minimum": 0,
"readOnly": true
},
"pause_duration": {
"type": "integer",
"description": "Duration in ns of the total time spent in 'pausing' synchronous operations (alert, synchronous XHR)",
"minimum": 0,
"readOnly": true
},
"forced_style_and_layout_duration": {
"type": "integer",
"description": "Duration in ns of the the total time spent processing forced layout and style inside this function",
"minimum": 0,
"readOnly": true
},
"start_time": {
"type": "number",
"description": "Time the entry function was invoked",
"minimum": 0,
"readOnly": true
},
"execution_start": {
"type": "number",
"description": "Time after compilation",
"minimum": 0,
"readOnly": true
},
"source_url": {
"type": "string",
"description": "The script resource name where available (or empty if not found)",
"readOnly": true
},
"source_function_name": {
"type": "string",
"description": "The script function name where available (or empty if not found)",
"readOnly": true
},
"source_char_position": {
"type": "integer",
"description": "The script character position where available (or -1 if not found)",
"readOnly": true
},
"invoker": {
"type": "string",
"description": "Information about the invoker of the script",
"readOnly": true
},
"invoker_type": {
"type": "string",
"description": "Type of the invoker of the script",
"enum": [
"user-callback",
"event-listener",
"resolve-promise",
"reject-promise",
"classic-script",
"module-script"
],
"readOnly": true
},
"window_attribution": {
"type": "string",
"description": "The container (the top-level document, or an <iframe>) the long animation frame occurred in",
"readOnly": true
}
}
},
"readOnly": true
}
},
"readOnly": true
Expand Down
49 changes: 49 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/resource-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,50 @@
"minimum": 0,
"readOnly": true
},
"encoded_body_size": {
"type": "integer",
"description": "Size in octet of the resource before removing any applied content encodings",
"minimum": 0,
"readOnly": true
},
"decoded_body_size": {
"type": "integer",
"description": "Size in octet of the resource after removing any applied encoding",
"minimum": 0,
"readOnly": true
},
"transfer_size": {
"type": "integer",
"description": "Size in octet of the fetched resource",
"minimum": 0,
"readOnly": true
},
"render_blocking_status": {
"type": "string",
"description": "Render blocking status of the resource",
"enum": ["blocking", "non-blocking"],
"readOnly": true
},
"worker": {
"type": "object",
"description": "Worker phase properties",
"required": ["duration", "start"],
"properties": {
"duration": {
"type": "integer",
"description": "Duration in nanoseconds of the resource worker phase",
"minimum": 0,
"readOnly": true
},
"start": {
"type": "integer",
"description": "Duration in nanoseconds between start of the request and start of the worker phase",
"minimum": 0,
"readOnly": true
}
},
"readOnly": true
},
"redirect": {
"type": "object",
"description": "Redirect phase properties",
Expand Down Expand Up @@ -189,6 +233,11 @@
},
"readOnly": true
},
"protocol": {
"type": "string",
"description": "Network protocol used to fetch the resource (e.g., 'http/1.1', 'h2')",
"readOnly": true
},
"provider": {
"type": "object",
"description": "The provider for this resource",
Expand Down
24 changes: 24 additions & 0 deletions features/dd-sdk-android-rum/src/main/json/rum/view-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
"minimum": 0,
"readOnly": true
},
"network_settled_time": {
"type": "integer",
"description": "Duration in ns from the moment the view was started until all the initial network requests settled",
"minimum": 0,
"readOnly": true
},
"interaction_to_next_view_time": {
"type": "integer",
"description": "Duration in ns to from the last interaction on previous view to the moment the current view was displayed",
"minimum": 0,
"readOnly": true
},
"loading_type": {
"type": "string",
"description": "Type of the loading of the view",
Expand Down Expand Up @@ -92,6 +104,12 @@
"minimum": 0,
"readOnly": true
},
"interaction_to_next_paint_time": {
"type": "integer",
"description": "Duration in ns between start of the view and start of the INP",
"minimum": 0,
"readOnly": true
},
"interaction_to_next_paint_target_selector": {
"type": "string",
"description": "CSS selector path of the interacted element corresponding to INP",
Expand All @@ -103,6 +121,12 @@
"minimum": 0,
"readOnly": true
},
"cumulative_layout_shift_time": {
"type": "integer",
"description": "Duration in ns between start of the view and start of the largest layout shift contributing to CLS",
"minimum": 0,
"readOnly": true
},
"cumulative_layout_shift_target_selector": {
"type": "string",
"description": "CSS selector path of the first element (in document order) of the largest layout shift contributing to CLS",
Expand Down
Loading

0 comments on commit 39039d1

Please sign in to comment.