Hystrix: Latency and Fault Tolerance for Distributed Systems



com.netflix.hystrix.strategy.metrics
Class HystrixMetricsPublisher

java.lang.Object
  extended by com.netflix.hystrix.strategy.metrics.HystrixMetricsPublisher

public abstract class HystrixMetricsPublisher
extends java.lang.Object

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.

See HystrixPlugins or the Hystrix GitHub Wiki for information on configuring plugins: https://github.com/Netflix/Hystrix/wiki/Plugins.


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

HystrixMetricsPublisher

public HystrixMetricsPublisher()
Method Detail

getMetricsPublisherForCommand

public HystrixMetricsPublisherCommand getMetricsPublisherForCommand(HystrixCommandKey commandKey,
                                                                    HystrixCommandGroupKey commandGroupKey,
                                                                    HystrixCommandMetrics metrics,
                                                                    HystrixCircuitBreaker circuitBreaker,
                                                                    HystrixCommandProperties properties)
Construct an implementation of HystrixMetricsPublisherCommand for HystrixCommand instances having key HystrixCommandKey.

This will be invoked once per HystrixCommandKey instance.

Default Implementation

Return instance of HystrixMetricsPublisherCommandDefault

Parameters:
commandKey - HystrixCommandKey representing the name or type of HystrixCommand
commandGroupKey - HystrixCommandGroupKey of HystrixCommand
metrics - HystrixCommandMetrics instance tracking metrics for HystrixCommand instances having the key as defined by HystrixCommandKey
circuitBreaker - HystrixCircuitBreaker instance for HystrixCommand instances having the key as defined by HystrixCommandKey
properties - HystrixCommandProperties instance for HystrixCommand instances having the key as defined by HystrixCommandKey
Returns:
instance of HystrixMetricsPublisherCommand that will have its initialize method invoked once.

getMetricsPublisherForThreadPool

public HystrixMetricsPublisherThreadPool getMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey,
                                                                          HystrixThreadPoolMetrics metrics,
                                                                          HystrixThreadPoolProperties properties)
Construct an implementation of HystrixMetricsPublisherThreadPool for HystrixThreadPool instances having key HystrixThreadPoolKey.

This will be invoked once per HystrixThreadPoolKey instance.

Default Implementation

Return instance of HystrixMetricsPublisherThreadPoolDefault

Parameters:
threadPoolKey - HystrixThreadPoolKey representing the name or type of HystrixThreadPool
metrics - HystrixThreadPoolMetrics instance tracking metrics for the HystrixThreadPool instance having the key as defined by HystrixThreadPoolKey
properties - HystrixThreadPoolProperties instance for the HystrixThreadPool instance having the key as defined by HystrixThreadPoolKey
Returns:
instance of HystrixMetricsPublisherThreadPool that will have its initialize method invoked once.