-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathITransaction.java
More file actions
96 lines (82 loc) · 2.51 KB
/
ITransaction.java
File metadata and controls
96 lines (82 loc) · 2.51 KB
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
package io.sentry;
import io.sentry.protocol.SentryId;
import io.sentry.protocol.TransactionNameSource;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;
public interface ITransaction extends ISpan {
/**
* Sets transaction name.
*
* @param name - transaction name
*/
void setName(@NotNull String name);
@ApiStatus.Internal
void setName(@NotNull String name, @NotNull TransactionNameSource transactionNameSource);
/**
* Returns transaction name.
*
* @return transaction name
*/
@NotNull
String getName();
/**
* Returns the source of the transaction name.
*
* @return transaction name source
*/
@NotNull
TransactionNameSource getTransactionNameSource();
@NotNull
@TestOnly
List<Span> getSpans();
/**
* Starts a child Span.
*
* @param operation - new span operation name
* @param description - the span description
* @param timestamp - the start timestamp of the span
* @return a new transaction span
*/
@NotNull
ISpan startChild(
@NotNull String operation, @Nullable String description, @Nullable SentryDate timestamp);
/**
* Returns if the profile of a transaction is sampled.
*
* @return profile is sampled
*/
@Nullable
Boolean isProfileSampled();
/**
* Returns the latest span that is not finished.
*
* @return span or null if not found.
*/
@Nullable
ISpan getLatestActiveSpan();
/** Schedules when transaction should be automatically finished. */
void scheduleFinish();
/**
* Force finishes the transaction and it's child spans with the specified status. If the
* transaction is already finished this is a no-op.
*
* @param status The status to set the unfinished child spans / transaction to.
* @param dropIfNoChildren true, if the transaction should be dropped when it e.g. contains no
* child spans. Usually true, but can be set to falseS for situations were the transaction and
* profile provide crucial context (e.g. ANRs)
* @param hint An optional hint to pass down to the client/transport layer
*/
@ApiStatus.Internal
void forceFinish(@NotNull final SpanStatus status, boolean dropIfNoChildren, @Nullable Hint hint);
@ApiStatus.Internal
void finish(
@Nullable SpanStatus status,
@Nullable SentryDate timestamp,
boolean dropIfNoChildren,
@Nullable Hint hint);
@NotNull
SentryId getEventId();
}