com.netflix.servo.monitor
Class MonitorConfig

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

public final class MonitorConfig
extends java.lang.Object

Configuration settings associated with a monitor. A config consists of a name that is required and an optional set of tags.


Nested Class Summary
static class MonitorConfig.Builder
          A builder to assist in creating monitor config objects.
 
Method Summary
static MonitorConfig.Builder builder(java.lang.String name)
          Return a builder instance with the specified name.
 boolean equals(java.lang.Object obj)
          
 java.lang.String getName()
          Returns the name of the metric.
 PublishingPolicy getPublishingPolicy()
          Returns the publishing policy.
 TagList getTags()
          Returns the tags associated with the metric.
 int hashCode()
          This class is immutable so we cache the hash code after the first time it is computed.
 java.lang.String toString()
          
 MonitorConfig withAdditionalTag(Tag tag)
          Returns a copy of the monitor config with an additional tag.
 MonitorConfig withAdditionalTags(TagList newTags)
          Returns a copy of the monitor config with additional tags.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

builder

public static MonitorConfig.Builder builder(java.lang.String name)
Return a builder instance with the specified name.


getName

public java.lang.String getName()
Returns the name of the metric.


getTags

public TagList getTags()
Returns the tags associated with the metric.


getPublishingPolicy

public PublishingPolicy getPublishingPolicy()
Returns the publishing policy.


equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
This class is immutable so we cache the hash code after the first time it is computed. The value 0 is used as an indicator that the hash code has not yet been computed, this means the cache won't work for a small set of inputs, but the impact should be minimal for a decent hash function. Similar technique is used for java String class.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

withAdditionalTag

public MonitorConfig withAdditionalTag(Tag tag)
Returns a copy of the monitor config with an additional tag.


withAdditionalTags

public MonitorConfig withAdditionalTags(TagList newTags)
Returns a copy of the monitor config with additional tags.