public abstract class HystrixEventNotifier
extends java.lang.Object
See HystrixPlugins
or the Hystrix GitHub Wiki for information on configuring plugins: https://github.com/Netflix/Hystrix/wiki/Plugins.
Note on thread-safety and performance
A single implementation of this class will be used globally so methods on this class will be invoked concurrently from multiple threads so all functionality must be thread-safe.
Methods are also invoked synchronously and will add to execution time of the commands so all behavior should be fast. If anything time-consuming is to be done it should be spawned asynchronously onto separate worker threads.
Constructor and Description |
---|
HystrixEventNotifier() |
Modifier and Type | Method and Description |
---|---|
void |
markCommandExecution(HystrixCommandKey key,
HystrixCommandProperties.ExecutionIsolationStrategy isolationStrategy,
int duration,
java.util.List<HystrixEventType> eventsDuringExecution)
Called after a command is executed using thread isolation.
|
void |
markEvent(HystrixEventType eventType,
HystrixCommandKey key)
Called for every event fired.
|
public void markEvent(HystrixEventType eventType, HystrixCommandKey key)
Default Implementation: Does nothing
eventType
- event typekey
- event keypublic void markCommandExecution(HystrixCommandKey key, HystrixCommandProperties.ExecutionIsolationStrategy isolationStrategy, int duration, java.util.List<HystrixEventType> eventsDuringExecution)
Will not get called if a command is rejected, short-circuited etc.
Default Implementation: Does nothing
key
- HystrixCommandKey
of command instance.isolationStrategy
- HystrixCommandProperties.ExecutionIsolationStrategy
the isolation strategy used by the command when executedduration
- time in milliseconds of executing run()
methodeventsDuringExecution
- List<HystrixEventType>
of events occurred during execution.