|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.usergrid.persistence.cassandra.util.TraceTagManager
public class TraceTagManager
Keeps the TraceTag as a ThreadLocal
Constructor Summary | |
---|---|
TraceTagManager()
|
Method Summary | |
---|---|
TraceTag |
acquire()
Get the tag from a ThreadLocal. |
void |
addTimer(TimedOpTag timedOpTag)
Add this TimedOpTag to the underlying trace if there is one. |
void |
attach(TraceTag traceTag)
Attache the tag to the current Thread. |
TraceTag |
create(String tagName)
Create a TraceTag |
TraceTag |
createMetered(String tagName)
|
TraceTag |
detach()
Detach the tag from the current thread. |
boolean |
getExplicitOnly()
Allow for/check against traces in piecemeal. |
int |
getFlushAtOpCount()
The maximum number of o TimedOpTag objects we can attach to a tracing instance. |
boolean |
getTraceEnabled()
|
boolean |
isActive()
Returns true if there is a trace in progress |
void |
setExplicitOnly(boolean explicitOnly)
|
void |
setFlushAtOpCount(int flushAtOpCount)
|
void |
setReportUnattached(boolean reportUnattached)
If set to true we log all TimedOpTag objects not attached to a Trace |
void |
setTraceEnabled(boolean traceEnabled)
Enable tracing. |
TimedOpTag |
timerInstance()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TraceTagManager()
Method Detail |
---|
public void setTraceEnabled(boolean traceEnabled)
traceEnabled
- public boolean getTraceEnabled()
public int getFlushAtOpCount()
public void setFlushAtOpCount(int flushAtOpCount)
public void setReportUnattached(boolean reportUnattached)
reportUnattached
- public boolean getExplicitOnly()
setTraceEnabled(boolean)
is set to false and you want callers
to control whether or not to initiate a trace. An example would be
initiating traces in a ServletFilter by looking for a header or parameter
as tracing all requests would be expensive.
public void setExplicitOnly(boolean explicitOnly)
public TraceTag acquire()
public TimedOpTag timerInstance()
public void addTimer(TimedOpTag timedOpTag)
TraceTag.getOpCount()
exceeded getFlushAtOpCount()
, then the trace is dumped to the reporter
and TraceTag.removeOps()
is invoked. The TraceTag
stay attached with the same name and ID, but now with no pending ops.
timedOpTag
- public boolean isActive()
public void attach(TraceTag traceTag)
traceTag
- public TraceTag detach()
public TraceTag create(String tagName)
public TraceTag createMetered(String tagName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |