com.netflix.servo.monitor
Class TimedInterface

java.lang.Object
  extended by com.netflix.servo.monitor.TimedInterface

public final class TimedInterface
extends java.lang.Object

This class creates a Proxy monitor that tracks all calls to methods of an interface.

   IDummy dummy = TimedInterface.newProxy(IDummy.class, new DummyImpl(), "id");
   DefaultMonitorRegistry.getInstance().register((CompositeMonitor)dummy);
 

All calls to methods implemented by IDummy would have an associated BasicTimer with them. The name for the CompositeMonitor is the name of the method. Additional tags are added:


Method Summary
static
<T> T
newProxy(java.lang.Class<T> ctype, T concrete)
          Creates a new TimedInterface for a given interface ctype with a concrete class concrete.
static
<T> T
newProxy(java.lang.Class<T> ctype, T concrete, java.lang.String id)
          Creates a new TimedInterface for a given interface ctype with a concrete class concrete and a specific id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newProxy

public static <T> T newProxy(java.lang.Class<T> ctype,
                             T concrete,
                             java.lang.String id)
Creates a new TimedInterface for a given interface ctype with a concrete class concrete and a specific id. The id can be used to distinguish among multiple objects with the same concrete class.


newProxy

public static <T> T newProxy(java.lang.Class<T> ctype,
                             T concrete)
Creates a new TimedInterface for a given interface ctype with a concrete class concrete.