forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSamplingContext.java
More file actions
30 lines (25 loc) · 988 Bytes
/
SamplingContext.java
File metadata and controls
30 lines (25 loc) · 988 Bytes
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
package io.sentry;
import io.sentry.util.Objects;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Context used by {@link io.sentry.SentryOptions.TracesSamplerCallback} to determine if transaction
* is going to be sampled.
*/
public final class SamplingContext {
private final @NotNull TransactionContext transactionContext;
private final @Nullable CustomSamplingContext customSamplingContext;
public SamplingContext(
final @NotNull TransactionContext transactionContext,
final @Nullable CustomSamplingContext customSamplingContext) {
this.transactionContext =
Objects.requireNonNull(transactionContext, "transactionContexts is required");
this.customSamplingContext = customSamplingContext;
}
public @Nullable CustomSamplingContext getCustomSamplingContext() {
return customSamplingContext;
}
public @NotNull TransactionContext getTransactionContext() {
return transactionContext;
}
}