com.netflix.servo.monitor
Class BasicCompositeMonitor

java.lang.Object
  extended by com.netflix.servo.monitor.BasicCompositeMonitor
All Implemented Interfaces:
CompositeMonitor<java.lang.Integer>, Monitor<java.lang.Integer>

public final class BasicCompositeMonitor
extends java.lang.Object
implements CompositeMonitor<java.lang.Integer>

Simple composite monitor type with a static list of sub-monitors. The value for the composite is the number of sub-monitors.


Constructor Summary
BasicCompositeMonitor(MonitorConfig config, java.util.List<Monitor<?>> monitors)
          Create a new composite.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 MonitorConfig getConfig()
          Configuration used to identify a monitor and provide metadata used in aggregations.
 java.util.List<Monitor<?>> getMonitors()
          Returns a list of sub-monitors for this composite.
 java.lang.Integer getValue()
          Returns the current value for the monitor.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicCompositeMonitor

public BasicCompositeMonitor(MonitorConfig config,
                             java.util.List<Monitor<?>> monitors)
Create a new composite.

Parameters:
config - configuration for the composite. It is recommended that the configuration shares common tags with the sub-monitors, but it is not enforced.
monitors - list of sub-monitors
Method Detail

getValue

public java.lang.Integer getValue()
Returns the current value for the monitor.

Specified by:
getValue in interface Monitor<java.lang.Integer>

getConfig

public MonitorConfig getConfig()
Configuration used to identify a monitor and provide metadata used in aggregations.

Specified by:
getConfig in interface Monitor<java.lang.Integer>

getMonitors

public java.util.List<Monitor<?>> getMonitors()
Returns a list of sub-monitors for this composite.

Specified by:
getMonitors in interface CompositeMonitor<java.lang.Integer>

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object