-
Notifications
You must be signed in to change notification settings - Fork 7
/
MomentsApi.java
102 lines (90 loc) · 3.46 KB
/
MomentsApi.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package io.embrace.android.embracesdk;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.Map;
/**
* The public API that is used to start & end moments.
*/
interface MomentsApi {
/**
* Starts a 'moment'. Moments are used for encapsulating particular activities within
* the app, such as a user adding an item to their shopping cart.
* <p>
* The length of time a moment takes to execute is recorded.
*
* @param name a name identifying the moment
*/
void startMoment(@NonNull String name);
/**
* Starts a 'moment'. Moments are used for encapsulating particular activities within
* the app, such as a user adding an item to their shopping cart.
* <p>
* The length of time a moment takes to execute is recorded.
*
* @param name a name identifying the moment
* @param identifier an identifier distinguishing between multiple moments with the same name
*/
void startMoment(@NonNull String name, @Nullable String identifier);
/**
* Starts a 'moment'. Moments are used for encapsulating particular activities within
* the app, such as a user adding an item to their shopping cart.
* <p>
* The length of time a moment takes to execute is recorded
*
* @param name a name identifying the moment
* @param identifier an identifier distinguishing between multiple moments with the same name
* @param properties custom key-value pairs to provide with the moment
*/
void startMoment(@NonNull String name,
@Nullable String identifier,
@Nullable Map<String, Object> properties);
/**
* Signals the end of a moment with the specified name.
* <p>
* The duration of the moment is computed.
*
* @param name the name of the moment to end
*/
void endMoment(@NonNull String name);
/**
* Signals the end of a moment with the specified name.
* <p>
* The duration of the moment is computed.
*
* @param name the name of the moment to end
* @param identifier the identifier of the moment to end, distinguishing between moments with the same name
*/
void endMoment(@NonNull String name, @Nullable String identifier);
/**
* Signals the end of a moment with the specified name.
* <p>
* The duration of the moment is computed.
*
* @param name the name of the moment to end
* @param properties custom key-value pairs to provide with the moment
*/
void endMoment(@NonNull String name,
@Nullable Map<String, Object> properties);
/**
* Signals the end of a moment with the specified name.
* <p>
* The duration of the moment is computed.
*
* @param name the name of the moment to end
* @param identifier the identifier of the moment to end, distinguishing between moments with the same name
* @param properties custom key-value pairs to provide with the moment
*/
void endMoment(@NonNull String name,
@Nullable String identifier,
@Nullable Map<String, Object> properties);
/**
* Signals that the app has completed startup.
*/
void endAppStartup();
/**
* Signals that the app has completed startup.
*
* @param properties properties to include as part of the startup moment
*/
void endAppStartup(@NonNull Map<String, Object> properties);
}