@@ -33,6 +33,14 @@ public static void init(BinaryMessenger messenger) {
33
33
ApmPigeon .ApmHostApi .setup (messenger , api );
34
34
}
35
35
36
+ /**
37
+ * The function sets the enabled status of APM.
38
+ *
39
+ * @param isEnabled The `setEnabled` method in the code snippet is used to enable or disable a
40
+ * feature, and it takes a `Boolean` parameter named `isEnabled`. When this method is called with
41
+ * `true`, it enables the feature, and when called with `false`, it disables the feature. The method
42
+ * internally calls
43
+ */
36
44
@ Override
37
45
public void setEnabled (@ NonNull Boolean isEnabled ) {
38
46
try {
@@ -42,6 +50,13 @@ public void setEnabled(@NonNull Boolean isEnabled) {
42
50
}
43
51
}
44
52
53
+ /**
54
+ * Sets the cold app launch enabled status using the APM library.
55
+ *
56
+ * @param isEnabled The `isEnabled` parameter is a Boolean value that indicates whether cold app launch
57
+ * is enabled or not. When `isEnabled` is set to `true`, cold app launch is enabled, and when it is set
58
+ * to `false`, cold app launch is disabled.
59
+ */
45
60
@ Override
46
61
public void setColdAppLaunchEnabled (@ NonNull Boolean isEnabled ) {
47
62
try {
@@ -51,6 +66,14 @@ public void setColdAppLaunchEnabled(@NonNull Boolean isEnabled) {
51
66
}
52
67
}
53
68
69
+ /**
70
+ * The function sets the auto UI trace enabled status in an APM system, handling any exceptions that
71
+ * may occur.
72
+ *
73
+ * @param isEnabled The `isEnabled` parameter is a Boolean value that indicates whether the Auto UI
74
+ * trace feature should be enabled or disabled. When `isEnabled` is set to `true`, the Auto UI trace
75
+ * feature is enabled, and when it is set to `false`, the feature is disabled.
76
+ */
54
77
@ Override
55
78
public void setAutoUITraceEnabled (@ NonNull Boolean isEnabled ) {
56
79
try {
@@ -60,6 +83,21 @@ public void setAutoUITraceEnabled(@NonNull Boolean isEnabled) {
60
83
}
61
84
}
62
85
86
+ /**
87
+ * Starts an execution trace and handles the result
88
+ * using callbacks.
89
+ *
90
+ * @param id The `id` parameter is a non-null String that represents the identifier of the execution
91
+ * trace.
92
+ * @param name The `name` parameter in the `startExecutionTrace` method represents the name of the
93
+ * execution trace that will be started. It is used as a reference to identify the trace during
94
+ * execution monitoring.
95
+ * @param result The `result` parameter in the `startExecutionTrace` method is an instance of
96
+ * `ApmPigeon.Result<String>`. This parameter is used to provide the result of the execution trace
97
+ * operation back to the caller. The `success` method of the `result` object is called with the
98
+ *
99
+ * @deprecated see {@link #startFlow}
100
+ */
63
101
@ Override
64
102
public void startExecutionTrace (@ NonNull String id , @ NonNull String name , ApmPigeon .Result <String > result ) {
65
103
ThreadManager .runOnBackground (
@@ -100,6 +138,17 @@ public void run() {
100
138
);
101
139
}
102
140
141
+ /**
142
+ * Starts an AppFlow with the specified name.
143
+ * <br/>
144
+ * On starting two flows with the same name the older flow will end with force abandon end reason.
145
+ * AppFlow name cannot exceed 150 characters otherwise it's truncated,
146
+ * leading and trailing whitespaces are also ignored.
147
+ *
148
+ * @param name AppFlow name. It can not be empty string or null.
149
+ * Starts a new AppFlow, if APM is enabled, feature is enabled
150
+ * and Instabug SDK is initialized.
151
+ */
103
152
@ Override
104
153
public void startFlow (@ NonNull String name ) {
105
154
try {
@@ -109,6 +158,26 @@ public void startFlow(@NonNull String name) {
109
158
}
110
159
}
111
160
161
+ /**
162
+ * Sets custom attributes for AppFlow with a given name.
163
+ * <br/>
164
+ * Setting an attribute value to null will remove its corresponding key if it already exists.
165
+ * <br/>
166
+ * Attribute key name cannot exceed 30 characters.
167
+ * Leading and trailing whitespaces are also ignored.
168
+ * Does not accept empty strings or null.
169
+ * <br/>
170
+ * Attribute value name cannot exceed 60 characters,
171
+ * leading and trailing whitespaces are also ignored.
172
+ * Does not accept empty strings.
173
+ * <br/>
174
+ * If a trace is ended, attributes will not be added and existing ones will not be updated.
175
+ * <br/>
176
+ *
177
+ * @param name AppFlow name. It can not be empty string or null
178
+ * @param key AppFlow attribute key. It can not be empty string or null
179
+ * @param value AppFlow attribute value. It can not be empty string. Null to remove attribute
180
+ */
112
181
@ Override
113
182
public void setFlowAttribute (@ NonNull String name , @ NonNull String key , @ Nullable String value ) {
114
183
try {
@@ -118,6 +187,11 @@ public void setFlowAttribute(@NonNull String name, @NonNull String key, @Nullabl
118
187
}
119
188
}
120
189
190
+ /**
191
+ * Ends AppFlow with a given name.
192
+ *
193
+ * @param name AppFlow name to be ended. It can not be empty string or null
194
+ */
121
195
@ Override
122
196
public void endFlow (@ NonNull String name ) {
123
197
try {
@@ -127,6 +201,15 @@ public void endFlow(@NonNull String name) {
127
201
}
128
202
}
129
203
204
+ /**
205
+ * Adds a new attribute to trace
206
+ *
207
+ * @param id String id of the trace.
208
+ * @param key attribute key
209
+ * @param value attribute value. Null to remove attribute
210
+ *
211
+ * @deprecated see {@link #setFlowAttribute}
212
+ */
130
213
@ Override
131
214
public void setExecutionTraceAttribute (@ NonNull String id , @ NonNull String key , @ NonNull String value ) {
132
215
try {
@@ -136,6 +219,13 @@ public void setExecutionTraceAttribute(@NonNull String id, @NonNull String key,
136
219
}
137
220
}
138
221
222
+ /**
223
+ * Ends a trace
224
+ *
225
+ * @param id string id of the trace.
226
+ *
227
+ * @deprecated see {@link #endFlow}
228
+ */
139
229
@ Override
140
230
public void endExecutionTrace (@ NonNull String id ) {
141
231
try {
@@ -145,6 +235,11 @@ public void endExecutionTrace(@NonNull String id) {
145
235
}
146
236
}
147
237
238
+ /**
239
+ * Starts a UI trace.
240
+ *
241
+ * @param name string name of the UI trace.
242
+ */
148
243
@ Override
149
244
public void startUITrace (@ NonNull String name ) {
150
245
try {
@@ -154,6 +249,9 @@ public void startUITrace(@NonNull String name) {
154
249
}
155
250
}
156
251
252
+ /**
253
+ * This method is used to terminate the currently active UI trace.
254
+ */
157
255
@ Override
158
256
public void endUITrace () {
159
257
try {
@@ -163,6 +261,9 @@ public void endUITrace() {
163
261
}
164
262
}
165
263
264
+ /**
265
+ * This method is used to signal the end of the app launch process.
266
+ */
166
267
@ Override
167
268
public void endAppLaunch () {
168
269
try {
@@ -172,6 +273,12 @@ public void endAppLaunch() {
172
273
}
173
274
}
174
275
276
+
277
+ /**
278
+ * logs network-related information
279
+ *
280
+ * @param data Map of network data object.
281
+ */
175
282
@ Override
176
283
public void networkLogAndroid (@ NonNull Map <String , Object > data ) {
177
284
try {
@@ -265,8 +372,13 @@ public void networkLogAndroid(@NonNull Map<String, Object> data) {
265
372
}
266
373
267
374
268
-
269
-
375
+ /**
376
+ * This method is responsible for initiating a custom performance UI trace
377
+ * in the APM module. It takes three parameters:
378
+ * @param screenName: A string representing the name of the screen or UI element being traced.
379
+ * @param microTimeStamp: A number representing the timestamp in microseconds when the trace is started.
380
+ * @param traceId: A number representing the unique identifier for the trace.
381
+ */
270
382
@ Override
271
383
public void startCpUiTrace (@ NonNull String screenName , @ NonNull Long microTimeStamp , @ NonNull Long traceId ) {
272
384
try {
@@ -276,6 +388,17 @@ public void startCpUiTrace(@NonNull String screenName, @NonNull Long microTimeSt
276
388
}
277
389
}
278
390
391
+
392
+ /**
393
+ * This method is responsible for reporting the screen
394
+ * loading data from Dart side to Android side. It takes three parameters:
395
+ * @param startTimeStampMicro: A number representing the start timestamp in microseconds of the screen
396
+ * loading custom performance data.
397
+ * @param durationMicro: A number representing the duration in microseconds of the screen loading custom
398
+ * performance data.
399
+ * @param uiTraceId: A number representing the unique identifier for the UI trace associated with the
400
+ * screen loading.
401
+ */
279
402
@ Override
280
403
public void reportScreenLoadingCP (@ NonNull Long startTimeStampMicro , @ NonNull Long durationMicro , @ NonNull Long uiTraceId ) {
281
404
try {
@@ -285,6 +408,15 @@ public void reportScreenLoadingCP(@NonNull Long startTimeStampMicro, @NonNull Lo
285
408
}
286
409
}
287
410
411
+
412
+ /**
413
+ * This method is responsible for extend the end time if the screen loading custom
414
+ * trace. It takes two parameters:
415
+ * @param timeStampMicro: A number representing the timestamp in microseconds when the screen loading
416
+ * custom trace is ending.
417
+ * @param uiTraceId: A number representing the unique identifier for the UI trace associated with the
418
+ * screen loading.
419
+ */
288
420
@ Override
289
421
public void endScreenLoadingCP (@ NonNull Long timeStampMicro , @ NonNull Long uiTraceId ) {
290
422
try {
@@ -294,11 +426,16 @@ public void endScreenLoadingCP(@NonNull Long timeStampMicro, @NonNull Long uiTra
294
426
}
295
427
}
296
428
429
+
430
+ /**
431
+ * This method is used to check whether the end screen loading feature is enabled or not.
432
+ */
297
433
@ Override
298
434
public void isEndScreenLoadingEnabled (@ NonNull ApmPigeon .Result <Boolean > result ) {
299
435
isScreenLoadingEnabled (result );
300
436
}
301
437
438
+
302
439
@ Override
303
440
public void isEnabled (@ NonNull ApmPigeon .Result <Boolean > result ) {
304
441
try {
@@ -310,6 +447,9 @@ public void isEnabled(@NonNull ApmPigeon.Result<Boolean> result) {
310
447
}
311
448
}
312
449
450
+ /**
451
+ * checks whether the screen loading feature is enabled.
452
+ * */
313
453
@ Override
314
454
public void isScreenLoadingEnabled (@ NonNull ApmPigeon .Result <Boolean > result ) {
315
455
try {
@@ -324,6 +464,9 @@ public void invoke(boolean isFeatureAvailable) {
324
464
}
325
465
}
326
466
467
+ /**
468
+ * This method is setting the enabled state of the screen loading feature.
469
+ */
327
470
@ Override
328
471
public void setScreenLoadingEnabled (@ NonNull Boolean isEnabled ) {
329
472
try {
0 commit comments