com.netflix.servo.tag
Class ThreadLocalTaggingContext

java.lang.Object
  extended by com.netflix.servo.tag.ThreadLocalTaggingContext
All Implemented Interfaces:
TaggingContext

public final class ThreadLocalTaggingContext
extends java.lang.Object
implements TaggingContext

Keeps track of tags that should be applied to counters incremented in the current thread. Can be used to customize the context for code executed in a particular thread. For example, on a server with a thread per request the context can be set so metrics will be tagged accordingly.


Method Summary
static ThreadLocalTaggingContext getInstance()
          Get the instance.
 TagList getTags()
          Get the tags associated with the current thread.
 void reset()
          Remove the tags associated with the current thread.
 void setTags(TagList tags)
          Set the tags to be associated with the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ThreadLocalTaggingContext getInstance()
Get the instance.


setTags

public void setTags(TagList tags)
Set the tags to be associated with the current thread.


getTags

public TagList getTags()
Get the tags associated with the current thread.

Specified by:
getTags in interface TaggingContext

reset

public void reset()
Remove the tags associated with the current thread.