Package io.sentry.transport
Class RateLimiter
java.lang.Object
io.sentry.transport.RateLimiter
- All Implemented Interfaces:
Closeable
,AutoCloseable
Controls retry limits on different category types sent to Sentry.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRateLimiter
(@NotNull SentryOptions options) RateLimiter
(@NotNull ICurrentDateProvider currentDateProvider, @NotNull SentryOptions options) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRateLimitObserver
(@NotNull RateLimiter.IRateLimitObserver observer) void
close()
@Nullable SentryEnvelope
filter
(@NotNull SentryEnvelope envelope, @NotNull Hint hint) boolean
isActiveForCategory
(@NotNull DataCategory dataCategory) boolean
void
removeRateLimitObserver
(@NotNull RateLimiter.IRateLimitObserver observer) void
updateRetryAfterLimits
(@Nullable String sentryRateLimitHeader, @Nullable String retryAfterHeader, int errorCode) Reads and update the rate limit Dictionary
-
Constructor Details
-
RateLimiter
public RateLimiter(@NotNull @NotNull ICurrentDateProvider currentDateProvider, @NotNull @NotNull SentryOptions options) -
RateLimiter
-
-
Method Details
-
filter
@Nullable public @Nullable SentryEnvelope filter(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull Hint hint) -
isActiveForCategory
-
isAnyRateLimitActive
public boolean isAnyRateLimitActive() -
updateRetryAfterLimits
public void updateRetryAfterLimits(@Nullable @Nullable String sentryRateLimitHeader, @Nullable @Nullable String retryAfterHeader, int errorCode) Reads and update the rate limit Dictionary- Parameters:
sentryRateLimitHeader
- the sentry rate limit headerretryAfterHeader
- the retry after headererrorCode
- the error code if set
-
addRateLimitObserver
-
removeRateLimitObserver
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-