public class DefaultTracer extends AbstractTracer
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BACKTRACE_PARAMETER_NAME |
static int |
DEFAULT_TRACER_FLAGS
By default tracers generate scoped metrics and generate transaction tracer segments.
|
static MetricNameFormat |
NULL_METRIC_NAME_FORMATTER
Convenience formatter
|
ATTRIBUTE_TYPE| Constructor and Description |
|---|
DefaultTracer(TransactionActivity txa,
ClassMethodSignature sig,
java.lang.Object object,
MetricNameFormat metricNameFormatter,
int tracerFlags) |
DefaultTracer(TransactionActivity txa,
ClassMethodSignature sig,
java.lang.Object object,
MetricNameFormat metricNameFormatter,
int tracerFlags,
long pStartTime)
Primary constructor for tracers created from weaved code or XML instrumentation.
|
DefaultTracer(TransactionActivity txa,
ClassMethodSignature sig,
java.lang.Object object,
MetricNameFormat metricNameFormatter,
long pStartTime) |
DefaultTracer(Transaction transaction,
ClassMethodSignature sig,
java.lang.Object object) |
DefaultTracer(Transaction transaction,
ClassMethodSignature sig,
java.lang.Object object,
MetricNameFormat metricNameFormatter) |
DefaultTracer(Transaction transaction,
ClassMethodSignature sig,
java.lang.Object object,
MetricNameFormat metricNameFormatter,
int tracerFlags)
Compatibility constructor for old code.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders) |
void |
childTracerFinished(long childDurationInNanos) |
void |
childTracerFinished(Tracer child)
Tells the tracer when a child tracer finished.
|
protected void |
doFinish(int opcode,
java.lang.Object returnValue)
Subclasses may override.
|
protected void |
doFinish(java.lang.Throwable throwable)
Subclasses may override.
|
protected void |
doRecordMetrics(TransactionStats transactionStats)
Generate additional metrics.
|
void |
finish(int opcode,
java.lang.Object returnValue) |
void |
finish(java.lang.Throwable throwable) |
int |
getChildCount() |
ClassMethodSignature |
getClassMethodSignature() |
long |
getDuration()
Get the duration of the method invocation in nanoseconds.
|
long |
getDurationInMilliseconds()
Get the duration of the method invocation in milliseconds.
|
long |
getEndTime()
Get the end time of the method invocation in nanoseconds.
|
long |
getEndTimeInMilliseconds()
Get the end time of the method invocation in milliseconds.
|
long |
getExclusiveDuration()
Get the duration in nanoseconds of the tracer minus the duration of all child tracers.
|
com.newrelic.api.agent.ExternalParameters |
getExternalParameters() |
java.lang.String |
getGuid()
Gets the random identifier of this Tracer.
|
protected java.lang.Object |
getInvocationTarget() |
java.lang.String |
getMetricName()
The metric name of this tracer.
|
protected MetricNameFormat |
getMetricNameFormat() |
Tracer |
getParentTracer()
Returns the parent tracer or null if this is the root tracer.
|
java.lang.String |
getRequestMetricName() |
long |
getRunningDurationInNanos()
Returns the elapsed time since the start time of the transaction up until now if the tracer is still running, or
the final duration if the tracer has finished.
|
long |
getStartTime()
Get the start time of the method invocation in nanoseconds.
|
long |
getStartTimeInMillis() |
long |
getStartTimeInMilliseconds()
Get the start time of the method invocation in milliseconds.
|
TransactionSegment |
getTransactionSegment(TransactionTracerConfig ttConfig,
SqlObfuscator sqlObfuscator,
long startTime,
TransactionSegment lastSibling) |
java.lang.String |
getTransactionSegmentName()
The name of this tracer in a transaction trace segment.
|
java.lang.String |
getTransactionSegmentUri()
The uri of this tracer in a tranaction trace segment.
|
boolean |
isAsync() |
boolean |
isChildHasStackTrace()
Gets the field childHasStackTrace.
|
boolean |
isLeaf() |
boolean |
isMetricProducer() |
boolean |
isParent()
Does the tracer have any children?
|
boolean |
isTransactionSegment()
Returns true if this tracer should participate in transaction trace.
|
void |
performFinishWork(long finishTime,
int opcode,
java.lang.Object returnValue) |
void |
readInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders) |
protected void |
recordMetrics(TransactionStats transactionStats)
Record response time metrics.
|
void |
removeTransactionSegment() |
void |
reportAsExternal(com.newrelic.agent.bridge.external.ExternalParameters externalParameters) |
void |
reportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters) |
protected void |
reset() |
void |
setMetricName(java.lang.String... metricNameParts) |
void |
setMetricNameFormat(MetricNameFormat nameFormat) |
void |
setMetricNameFormatInfo(java.lang.String metricName,
java.lang.String transactionSegmentName,
java.lang.String transactionSegmentUri) |
void |
setParentTracer(Tracer tracer) |
protected boolean |
shouldStoreStackTrace() |
void |
storeStackTrace()
Stores the stack trace.
|
addCustomAttribute, addCustomAttribute, addCustomAttribute, addCustomAttributes, addExclusiveRollupMetricName, addRollupMetricName, getAgentAttribute, getAgentAttributes, getCustomAttribute, getCustomAttributes, getException, getExclusiveRollupMetricNames, getParentTracedMethod, getParentTracerWithSpan, getRollupMetricNames, getTransaction, getTransactionActivity, invoke, isTrackCallbackRunnable, markFinishTime, nameTransaction, removeAgentAttribute, setAgentAttribute, setAttribute, setCustomMetricPrefix, setNoticedError, setRollupMetricNames, setThrownException, setTrackCallbackRunnable, setTrackChildThreads, trackChildThreads, wasExceptionSetByAPIpublic static final MetricNameFormat NULL_METRIC_NAME_FORMATTER
public static final java.lang.String BACKTRACE_PARAMETER_NAME
public static final int DEFAULT_TRACER_FLAGS
public DefaultTracer(Transaction transaction, ClassMethodSignature sig, java.lang.Object object, MetricNameFormat metricNameFormatter, int tracerFlags)
transaction - transaction, must not be null.sig - object - metricNameFormatter - tracerFlags - public DefaultTracer(TransactionActivity txa, ClassMethodSignature sig, java.lang.Object object, MetricNameFormat metricNameFormatter, int tracerFlags)
public DefaultTracer(TransactionActivity txa, ClassMethodSignature sig, java.lang.Object object, MetricNameFormat metricNameFormatter, int tracerFlags, long pStartTime)
txa - activity, must not be null.sig - object - metricNameFormatter - tracerFlags - public DefaultTracer(TransactionActivity txa, ClassMethodSignature sig, java.lang.Object object, MetricNameFormat metricNameFormatter, long pStartTime)
public DefaultTracer(Transaction transaction, ClassMethodSignature sig, java.lang.Object object, MetricNameFormat metricNameFormatter)
public DefaultTracer(Transaction transaction, ClassMethodSignature sig, java.lang.Object object)
public void removeTransactionSegment()
public java.lang.String getGuid()
ErrorTracerpublic void finish(java.lang.Throwable throwable)
protected void reset()
public void finish(int opcode,
java.lang.Object returnValue)
public void performFinishWork(long finishTime,
int opcode,
java.lang.Object returnValue)
public long getStartTimeInMillis()
getStartTimeInMillis in interface TracergetStartTimeInMillis in class AbstractTracerpublic com.newrelic.api.agent.ExternalParameters getExternalParameters()
getExternalParameters in interface TracergetExternalParameters in class AbstractTracerprotected void doFinish(java.lang.Throwable throwable)
protected void doFinish(int opcode,
java.lang.Object returnValue)
protected boolean shouldStoreStackTrace()
public void storeStackTrace()
public long getRunningDurationInNanos()
Tracerpublic long getDurationInMilliseconds()
TimedItempublic long getDuration()
TimedItempublic long getExclusiveDuration()
Tracerpublic long getEndTime()
Tracerpublic long getEndTimeInMilliseconds()
Tracerpublic long getStartTime()
Tracerpublic long getStartTimeInMilliseconds()
Tracerprotected final java.lang.Object getInvocationTarget()
getInvocationTarget in class AbstractTracerpublic Tracer getParentTracer()
Tracerpublic void setParentTracer(Tracer tracer)
public java.lang.String getRequestMetricName()
public void setMetricNameFormat(MetricNameFormat nameFormat)
protected final MetricNameFormat getMetricNameFormat()
public final java.lang.String getMetricName()
Tracerpublic final java.lang.String getTransactionSegmentName()
Tracerpublic final java.lang.String getTransactionSegmentUri()
Tracerprotected void recordMetrics(TransactionStats transactionStats)
protected void doRecordMetrics(TransactionStats transactionStats)
public final boolean isParent()
Tracerpublic void childTracerFinished(Tracer child)
Tracerpublic int getChildCount()
public void childTracerFinished(long childDurationInNanos)
public ClassMethodSignature getClassMethodSignature()
getClassMethodSignature in interface TracergetClassMethodSignature in class AbstractTracerpublic final boolean isTransactionSegment()
Tracerpublic boolean isMetricProducer()
public final boolean isLeaf()
isLeaf in interface TracerisLeaf in class AbstractTracerpublic final boolean isAsync()
isAsync in interface TracerisAsync in class AbstractTracerpublic boolean isChildHasStackTrace()
isChildHasStackTrace in interface TracerisChildHasStackTrace in class AbstractTracerpublic TransactionSegment getTransactionSegment(TransactionTracerConfig ttConfig, SqlObfuscator sqlObfuscator, long startTime, TransactionSegment lastSibling)
public void setMetricName(java.lang.String... metricNameParts)
public void setMetricNameFormatInfo(java.lang.String metricName,
java.lang.String transactionSegmentName,
java.lang.String transactionSegmentUri)
public void addOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
addOutboundRequestHeaders in interface com.newrelic.api.agent.TracedMethodaddOutboundRequestHeaders in class AbstractTracerpublic void readInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)
readInboundResponseHeaders in class AbstractTracerpublic void reportAsExternal(com.newrelic.agent.bridge.external.ExternalParameters externalParameters)
reportAsExternal in class AbstractTracerpublic void reportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters)
reportAsExternal in interface com.newrelic.api.agent.TracedMethodreportAsExternal in class AbstractTracer