@@ -17,6 +17,8 @@ internal protocol RUMCommand {
17
17
var canStartBackgroundView : Bool { get }
18
18
/// Whether or not receiving this command should start the "ApplicationLaunch" view if no view was yet started in current app process.
19
19
var canStartApplicationLaunchView : Bool { get }
20
+ /// Whether or not this command is considered a user intaraction
21
+ var isUserInteraction : Bool { get }
20
22
}
21
23
22
24
// MARK: - RUM View related commands
@@ -26,6 +28,7 @@ internal struct RUMStartViewCommand: RUMCommand {
26
28
var attributes : [ AttributeKey : AttributeValue ]
27
29
let canStartBackgroundView = false // no, it should start its own view, not the "Background"
28
30
let canStartApplicationLaunchView = false // no, it should start its own view, not the "ApplicationLaunch"
31
+ let isUserInteraction = true // a new View means there was a navigation, it's considered a User interaction
29
32
30
33
/// The value holding stable identity of the RUM View.
31
34
let identity : RUMViewIdentifiable
@@ -56,6 +59,7 @@ internal struct RUMStopViewCommand: RUMCommand {
56
59
var attributes : [ AttributeKey : AttributeValue ]
57
60
let canStartBackgroundView = false // no, we don't expect receiving it without an active view
58
61
let canStartApplicationLaunchView = false // no, we don't expect receiving it without an active view
62
+ let isUserInteraction = false // a view can be stopped and in most cases should not be considered an interaction (if it's stopped because the user navigate inside the same app, the startView will happen shortly after this)
59
63
60
64
/// The value holding stable identity of the RUM View.
61
65
let identity : RUMViewIdentifiable
@@ -66,6 +70,7 @@ internal struct RUMAddCurrentViewErrorCommand: RUMCommand {
66
70
var attributes : [ AttributeKey : AttributeValue ]
67
71
let canStartBackgroundView = true // yes, we want to track errors in "Background" view
68
72
let canStartApplicationLaunchView = true // yes, we want to track errors in "ApplicationLaunch" view
73
+ let isUserInteraction = false // an error is not an interactive event
69
74
70
75
/// The error message.
71
76
let message : String
@@ -124,6 +129,7 @@ internal struct RUMAddViewTimingCommand: RUMCommand {
124
129
var attributes : [ AttributeKey : AttributeValue ]
125
130
let canStartBackgroundView = false // no, it doesn't make sense to start "Background" view on receiving custom timing, as it will be `0ns` timing
126
131
let canStartApplicationLaunchView = false // no, it doesn't make sense to start "ApplicationLaunch" view on receiving custom timing, as it will be `0ns` timing
132
+ let isUserInteraction = false // a custom view timing is not an interactive event
127
133
128
134
/// The name of the timing. It will be used as a JSON key, whereas the value will be the timing duration,
129
135
/// measured since the start of the View.
@@ -150,6 +156,7 @@ internal struct RUMStartResourceCommand: RUMResourceCommand {
150
156
var attributes : [ AttributeKey : AttributeValue ]
151
157
let canStartBackgroundView = true // yes, we want to track resources in "Background" view
152
158
let canStartApplicationLaunchView = true // yes, we want to track resources in "ApplicationLaunch" view
159
+ let isUserInteraction = false // a resource is not an interactive event
153
160
154
161
/// Resource url
155
162
let url : String
@@ -167,6 +174,7 @@ internal struct RUMAddResourceMetricsCommand: RUMResourceCommand {
167
174
var attributes : [ AttributeKey : AttributeValue ]
168
175
let canStartBackgroundView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
169
176
let canStartApplicationLaunchView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
177
+ let isUserInteraction = false // an error is not an interactive event
170
178
171
179
/// Resource metrics.
172
180
let metrics : ResourceMetrics
@@ -178,6 +186,7 @@ internal struct RUMStopResourceCommand: RUMResourceCommand {
178
186
var attributes : [ AttributeKey : AttributeValue ]
179
187
let canStartBackgroundView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
180
188
let canStartApplicationLaunchView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
189
+ let isUserInteraction = false // a resource is not an interactive event
181
190
182
191
/// A type of the Resource
183
192
let kind : RUMResourceType
@@ -193,6 +202,7 @@ internal struct RUMStopResourceWithErrorCommand: RUMResourceCommand {
193
202
var attributes : [ AttributeKey : AttributeValue ]
194
203
let canStartBackgroundView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
195
204
let canStartApplicationLaunchView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartResourceCommand`)
205
+ let isUserInteraction = false // a resource is not an interactive event
196
206
197
207
/// The error message.
198
208
let errorMessage : String
@@ -266,6 +276,7 @@ internal struct RUMStartUserActionCommand: RUMUserActionCommand {
266
276
var attributes : [ AttributeKey : AttributeValue ]
267
277
let canStartBackgroundView = true // yes, we want to track actions in "Background" view (e.g. it makes sense for custom actions)
268
278
let canStartApplicationLaunchView = true // yes, we want to track actions in "ApplicationLaunch" view (e.g. it makes sense for custom actions)
279
+ let isUserInteraction = true // a user action definitely is a User Interacgion
269
280
270
281
let actionType : RUMUserActionType
271
282
let name : String
@@ -277,6 +288,7 @@ internal struct RUMStopUserActionCommand: RUMUserActionCommand {
277
288
var attributes : [ AttributeKey : AttributeValue ]
278
289
let canStartBackgroundView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartUserActionCommand`)
279
290
let canStartApplicationLaunchView = false // no, we don't expect receiving it without an active view (started earlier on `RUMStartUserActionCommand`)
291
+ let isUserInteraction = true // a user action definitely is a User Interacgion
280
292
281
293
let actionType : RUMUserActionType
282
294
let name : String ?
@@ -288,6 +300,7 @@ internal struct RUMAddUserActionCommand: RUMUserActionCommand {
288
300
var attributes : [ AttributeKey : AttributeValue ]
289
301
let canStartBackgroundView = true // yes, we want to track actions in "Background" view (e.g. it makes sense for custom actions)
290
302
let canStartApplicationLaunchView = true // yes, we want to track actions in "ApplicationLaunch" view (e.g. it makes sense for custom actions)
303
+ let isUserInteraction = true // a user action definitely is a User Interacgion
291
304
292
305
let actionType : RUMUserActionType
293
306
let name : String
@@ -300,6 +313,7 @@ internal struct RUMAddLongTaskCommand: RUMCommand {
300
313
var attributes : [ AttributeKey : AttributeValue ]
301
314
let canStartBackgroundView = false // no, we don't expect receiving long tasks in "Background" view
302
315
let canStartApplicationLaunchView = true // yes, we want to track long tasks in "ApplicationLaunch" view (e.g. any hitches before presenting first UI)
316
+ let isUserInteraction = false // a long task is not an interactive event
303
317
304
318
let duration : TimeInterval
305
319
}
@@ -310,6 +324,7 @@ internal struct RUMAddLongTaskCommand: RUMCommand {
310
324
internal struct RUMKeepSessionAliveCommand : RUMCommand {
311
325
let canStartBackgroundView = false
312
326
let canStartApplicationLaunchView = false
327
+ let isUserInteraction = false
313
328
var time : Date
314
329
var attributes : [ AttributeKey : AttributeValue ]
315
330
}
0 commit comments