Modifier and Type | Class and Description |
---|---|
static class |
Execution.Trace.Level
Defines what information is added at which trace level
|
static class |
Execution.Trace.LogValue
An immutable access log value added to the trace
|
private static class |
Execution.Trace.PropertyValueVisitor
Visits all trace nodes to collect the last set value of a particular property in a trace tree
|
Modifier and Type | Field and Description |
---|---|
private boolean |
forceTimestamps
If true, do timing logic, even though trace level is low.
|
private int |
traceLevel
The highest level of tracing this should record
|
private com.yahoo.yolean.trace.TraceNode |
traceNode
The node in the trace tree capturing this execution
|
Modifier | Constructor and Description |
---|---|
private |
Trace(int traceLevel,
com.yahoo.yolean.trace.TraceNode traceNode,
boolean forceTimestamps)
Creates a new instance by assigning the internal state of this directly
|
Modifier and Type | Method and Description |
---|---|
<VISITOR extends com.yahoo.yolean.trace.TraceVisitor> |
accept(VISITOR visitor)
Visits the entire trace tree
|
Execution.Trace |
createChild()
Creates a trace node below a parent
|
static Execution.Trace |
createRoot(int traceLevel)
Creates an empty root trace with a given level of tracing
|
boolean |
getForceTimestamps() |
Object |
getProperty(String name)
Returns a property set anywhere in the trace tree this points to.
|
int |
getTraceLevel()
Returns the maximum trace level this will record
|
void |
logValue(String key,
String value)
Adds a key-value which will be logged to the access log of this request.
|
Iterator<Execution.Trace.LogValue> |
logValueIterator()
Returns the values that should be written to the access log set in the entire trace node tree
|
void |
setForceTimestamps(boolean forceTimestamps) |
void |
setProperty(String name,
Object value)
Adds a property key-value to this trace.
|
void |
setTraceLevel(int traceLevel)
Sets the maximum trace level this will record
|
private static long |
timestamp(int traceLevel,
boolean forceTimestamps) |
String |
toString()
Returns a short string description of this
|
void |
trace(String message,
int traceLevel)
Adds a trace message to this trace, if this trace has at most the given trace level
|
com.yahoo.yolean.trace.TraceNode |
traceNode()
Returns the trace node peer of this
|
private com.yahoo.yolean.trace.TraceNode traceNode
private int traceLevel
private boolean forceTimestamps
private Trace(int traceLevel, com.yahoo.yolean.trace.TraceNode traceNode, boolean forceTimestamps)
public static Execution.Trace createRoot(int traceLevel)
public Execution.Trace createChild()
public int getTraceLevel()
public void setTraceLevel(int traceLevel)
public void setForceTimestamps(boolean forceTimestamps)
public boolean getForceTimestamps()
public void trace(String message, int traceLevel)
public void logValue(String key, String value)
public Iterator<Execution.Trace.LogValue> logValueIterator()
public <VISITOR extends com.yahoo.yolean.trace.TraceVisitor> VISITOR accept(VISITOR visitor)
public void setProperty(String name, Object value)
name
- the name of the propertyvalue
- the value of the property, or null to set this property to nullpublic Object getProperty(String name)
This method have a time complexity which is proportional to the number of trace nodes in the tree
public com.yahoo.yolean.trace.TraceNode traceNode()
public String toString()
private static long timestamp(int traceLevel, boolean forceTimestamps)
Copyright © 2018. All rights reserved.