com.netflix.hystrix.contrib.networkauditor
Interface HystrixNetworkAuditorEventListener


public interface HystrixNetworkAuditorEventListener

Event listener that gets implemented and registered with HystrixNetworkAuditorAgent.registerEventListener(HystrixNetworkAuditorEventListener) by the application running Hystrix in the application classloader into this JavaAgent running in the boot classloader so events can be invoked on code inside the application classloader.


Method Summary
 void handleNetworkEvent()
          Invoked by the HystrixNetworkAuditorAgent when network events occur.
 

Method Detail

handleNetworkEvent

void handleNetworkEvent()
Invoked by the HystrixNetworkAuditorAgent when network events occur.

An event may be the opening of a socket, channel or reading/writing bytes. It is not guaranteed to be a one-to-one relationship with a request/response.

No arguments are returned as it is left to the implementation to decide whether the current thread stacktrace should be captured or not.

Typical implementations will want to filter to non-Hystrix isolated network traffic with code such as this:

 if (Hystrix.getCurrentThreadExecutingCommand() == null) {
      // this event is not inside a Hystrix context (according to ThreadLocal variables)
      StackTraceElement[] stack = Thread.currentThread().getStackTrace();
      // increment counters, fire alerts, log stack traces etc
 }