com.netflix.hystrix.contrib.metrics.eventstream
Class HystrixMetricsPoller

java.lang.Object
  extended by com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsPoller

public class HystrixMetricsPoller
extends java.lang.Object

Polls Hystrix metrics and output JSON strings for each metric to a MetricsPollerListener.

Polling can be stopped/started. Use shutdown() to permanently shutdown the poller.


Nested Class Summary
static interface HystrixMetricsPoller.MetricsAsJsonPollerListener
           
static class HystrixMetricsPoller.UnitTest
           
 
Constructor Summary
HystrixMetricsPoller(HystrixMetricsPoller.MetricsAsJsonPollerListener listener, int delay)
          Allocate resources to begin polling.
 
Method Summary
 boolean isRunning()
           
 void pause()
          Pause (stop) polling.
 void shutdown()
          Stops polling and shuts down the ExecutorService.
 void start()
          Start polling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HystrixMetricsPoller

public HystrixMetricsPoller(HystrixMetricsPoller.MetricsAsJsonPollerListener listener,
                            int delay)
Allocate resources to begin polling.

Use start to begin polling.

Use shutdown to cleanup resources and stop polling.

Use pause to temporarily stop polling that can be restarted again with start.

Parameters:
MetricsAsJsonPollerListener - for callbacks
delay -
Method Detail

start

public void start()
Start polling.


pause

public void pause()
Pause (stop) polling. Polling can be started again with start as long as shutdown is not called.


shutdown

public void shutdown()
Stops polling and shuts down the ExecutorService.

This instance can no longer be used after calling shutdown.


isRunning

public boolean isRunning()