Append a custom sentry to the current sentry.
Append a custom sentry to the current sentry.
the sentry to add
a new sentry that applies the given sentry after the current sentry behavior
Returns the registered instance of the sentry (when applicable).
Returns the registered instance of the sentry (when applicable).
Append an adaptive throughput sentry to the current sentry.
Append an adaptive throughput sentry to the current sentry. See AdaptiveThroughputSentry for more information.
target success ratio, 0 < targetSuccessRatio < 1
, defaults to 0.95
a new sentry that adaptively changes allowed throughput on top of the current sentry behavior
Append a concurrency limit sentry to the current sentry.
Append a concurrency limit sentry to the current sentry.
number of concurrently allowed invocations
a new sentry that applies a concurrency limit after the current sentry behavior
Append a invocation duration limit sentry to the current sentry.
Append a invocation duration limit sentry to the current sentry.
WARNING: do NOT use this sentry when you invoke it from 1) a akka.dispatch.Future or 2) an akka.actor.Actor. For such circumstances you are MUCH better of with a timeout on the enclosing future or a timeout message within the actor. Reason: this sentry blocks the current thread while waiting on a future that executes the task. Blocking the current thread is an anti-pattern for futures and actors.
the maximum duration of a call
a new sentry that applies a duration limit after the current sentry behavior
Append a circuit breaker sentry to the current sentry.
Append a circuit breaker sentry to the current sentry.
number of failure after which the flow will be broken
timeout for trying again
a new sentry that applies a circuit breaker after the current sentry behavior
Append an extensive metrics sentry to the current sentry.
Append an extensive metrics sentry to the current sentry.
Four timers are registered: "all", "success", "fail" and "notAvailable". These are update for respectively each invocation, succeeding invocations, invocations that throw an exception, and invocations that are blocked by a sentry that is later in the chain (detected by catching NotAvailableExceptions).
When 4 timers is too much detail, use .withMetrics instead.
a new sentry that collects metrics after the current sentry behavior
Append a metrics sentry to the current sentry.
Append a metrics sentry to the current sentry.
One timer is registered: "all". It is update for each invocation. For more extensive measuring, use .withFullMetrics instead.
a new sentry that collects metrics after the current sentry behavior
Append a rate limit sentry to the current sentry.
Append a rate limit sentry to the current sentry.
number of invocations per time unit
the time unit in millis
a new sentry that applies a concurrency limit after the current sentry behavior
Lots of code to make creating sentries trivially easy.
For usage instructions see nl.grons.sentries.SentrySupport.