|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.hystrix.strategy.metrics.HystrixMetricsPublisher
public abstract class HystrixMetricsPublisher
Abstract class with default implementations of Factory methods for creating "Metrics Publisher" instances for getting metrics and other related data exposed, published or otherwise retrievable by external systems such as Servo (https://github.com/Netflix/servo) for monitoring and statistical purposes.
Custom implementations of this interface can be used to override default behavior via 2 mechanisms:
1) Injection
Implementations can be injected into HystrixCommand and HystrixCollapser implementation constructors.
2) Plugin
Using HystrixPlugins.registerMetricsPublisher(com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisher) an implementation can be registered globally to take precedence and override all other implementations.
The order of precedence is:
HystrixPlugins.registerMetricsPublisher(com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisher)HystrixCommand and HystrixCollapser constructorsHystrixMetricsPublisherDefault
The injection approach is effective for HystrixCommand and HystrixCollapser implementations where you wish to have a different default mechanism for publishing metrics without
overriding all implementations. It is also useful when distributing a library where static override should not be used.
The globally registered plugin is useful when using commands from 3rd party libraries and you want to override how properties are defined for all implementations in your entire system.
| Constructor Summary | |
|---|---|
HystrixMetricsPublisher()
|
|
| Method Summary | |
|---|---|
HystrixMetricsPublisherCommand |
getMetricsPublisherForCommand(HystrixCommandKey commandKey,
HystrixCommandGroupKey commandGroupKey,
HystrixCommandMetrics metrics,
HystrixCircuitBreaker circuitBreaker,
HystrixCommandProperties properties)
Construct an implementation of HystrixMetricsPublisherCommand for HystrixCommand instances having key HystrixCommandKey. |
HystrixMetricsPublisherThreadPool |
getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey,
HystrixThreadPoolMetrics metrics,
HystrixThreadPoolProperties properties)
Construct an implementation of HystrixMetricsPublisherThreadPool for HystrixThreadPool instances having key HystrixThreadPoolKey. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HystrixMetricsPublisher()
| Method Detail |
|---|
public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey,
HystrixCommandGroupKey commandGroupKey,
HystrixCommandMetrics metrics,
HystrixCircuitBreaker circuitBreaker,
HystrixCommandProperties properties)
HystrixMetricsPublisherCommand for HystrixCommand instances having key HystrixCommandKey.
This will be invoked once per HystrixCommandKey instance.
Default Implementation
Return instance of HystrixMetricsPublisherCommandDefault
commandKey - HystrixCommandKey representing the name or type of HystrixCommandcommandGroupKey - HystrixCommandGroupKey of HystrixCommandmetrics - HystrixCommandMetrics instance tracking metrics for HystrixCommand instances having the key as defined by HystrixCommandKeycircuitBreaker - HystrixCircuitBreaker instance for HystrixCommand instances having the key as defined by HystrixCommandKeyproperties - HystrixCommandProperties instance for HystrixCommand instances having the key as defined by HystrixCommandKey
HystrixMetricsPublisherCommand that will have its initialize method invoked once.
public HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey,
HystrixThreadPoolMetrics metrics,
HystrixThreadPoolProperties properties)
HystrixMetricsPublisherThreadPool for HystrixThreadPool instances having key HystrixThreadPoolKey.
This will be invoked once per HystrixThreadPoolKey instance.
Default Implementation
Return instance of HystrixMetricsPublisherThreadPoolDefault
threadPoolKey - HystrixThreadPoolKey representing the name or type of HystrixThreadPoolmetrics - HystrixThreadPoolMetrics instance tracking metrics for the HystrixThreadPool instance having the key as defined by HystrixThreadPoolKeyproperties - HystrixThreadPoolProperties instance for the HystrixThreadPool instance having the key as defined by HystrixThreadPoolKey
HystrixMetricsPublisherThreadPool that will have its initialize method invoked once.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||