Package com.newrelic.agent.bridge
Class NoOpTracedMethod
- java.lang.Object
-
- com.newrelic.agent.bridge.NoOpTracedMethod
-
- All Implemented Interfaces:
TracedMethod,com.newrelic.api.agent.AttributeHolder,com.newrelic.api.agent.TracedMethod
public final class NoOpTracedMethod extends java.lang.Object implements TracedMethod
-
-
Field Summary
Fields Modifier and Type Field Description static TracedMethodINSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCustomAttribute(java.lang.String key, boolean value)voidaddCustomAttribute(java.lang.String key, java.lang.Number value)voidaddCustomAttribute(java.lang.String key, java.lang.String value)voidaddCustomAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)voidaddExclusiveRollupMetricName(java.lang.String... metricNameParts)Add a rollup metric name that reports the exclusive time for both total and exclusive times.voidaddOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders)Do not use.voidaddRollupMetricName(java.lang.String... metricNameParts)voidexcludeLeaf()Mark a leaf tracer as excluded, similar to how excludeFromTransactionTrace works.java.lang.StringgetMetricName()TracedMethodgetParentTracedMethod()Returns the parent of this traced method, or null if this is the root tracer.booleanisMetricProducer()Returns true if this tracer produces a metric.booleanisTrackCallbackRunnable()voidnameTransaction(TransactionNamePriority namePriority)Names the current transaction using this traced method.voidreadInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)Do not use.voidreportAsExternal(ExternalParameters externalParameters)voidreportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters)voidsetCustomMetricPrefix(java.lang.String prefix)Set the prefix for the metric name.voidsetMetricName(java.lang.String... metricNameParts)voidsetMetricNameFormatInfo(java.lang.String metricName, java.lang.String transactionSegmentName, java.lang.String transactionSegmentUri)Sets the traced method metric name, transaction segment name, and transaction segment URI.voidsetRollupMetricNames(java.lang.String... metricNames)voidsetTrackCallbackRunnable(boolean shouldTrack)Tell the tracer to track child CallbackRunnable jobs which are submitted under its method call.voidsetTrackChildThreads(boolean shouldTrack)Tell the tracer to track child async jobs which are submitted under its method call.booleantrackChildThreads()
-
-
-
Field Detail
-
INSTANCE
public static final TracedMethod INSTANCE
-
-
Method Detail
-
setMetricName
public void setMetricName(java.lang.String... metricNameParts)
- Specified by:
setMetricNamein interfacecom.newrelic.api.agent.TracedMethod
-
nameTransaction
public void nameTransaction(TransactionNamePriority namePriority)
Description copied from interface:TracedMethodNames the current transaction using this traced method. This is called by code injected as a result of xml instrumentation. This probably shouldn't be invoked directly.- Specified by:
nameTransactionin interfaceTracedMethod- Parameters:
namePriority- The priority to be given to the naming call.
-
getParentTracedMethod
public TracedMethod getParentTracedMethod()
Description copied from interface:TracedMethodReturns the parent of this traced method, or null if this is the root tracer.- Specified by:
getParentTracedMethodin interfaceTracedMethod- Returns:
- the parent TracedMethod of the current traced method.
-
addCustomAttribute
public void addCustomAttribute(java.lang.String key, java.lang.Number value)- Specified by:
addCustomAttributein interfacecom.newrelic.api.agent.AttributeHolder
-
addCustomAttribute
public void addCustomAttribute(java.lang.String key, java.lang.String value)- Specified by:
addCustomAttributein interfacecom.newrelic.api.agent.AttributeHolder
-
addCustomAttribute
public void addCustomAttribute(java.lang.String key, boolean value)- Specified by:
addCustomAttributein interfacecom.newrelic.api.agent.AttributeHolder
-
addCustomAttributes
public void addCustomAttributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
- Specified by:
addCustomAttributesin interfacecom.newrelic.api.agent.AttributeHolder
-
getMetricName
public java.lang.String getMetricName()
- Specified by:
getMetricNamein interfacecom.newrelic.api.agent.TracedMethod
-
setRollupMetricNames
public void setRollupMetricNames(java.lang.String... metricNames)
- Specified by:
setRollupMetricNamesin interfaceTracedMethod
-
addRollupMetricName
public void addRollupMetricName(java.lang.String... metricNameParts)
- Specified by:
addRollupMetricNamein interfacecom.newrelic.api.agent.TracedMethod
-
addExclusiveRollupMetricName
public void addExclusiveRollupMetricName(java.lang.String... metricNameParts)
Description copied from interface:TracedMethodAdd a rollup metric name that reports the exclusive time for both total and exclusive times. The reason for this is that external and database charts on APM show stacked graphs based on total duration of our rollup metrics, when the intent seems to be to show stacked graphs of exclusive durations. Previous tracer implementations like AbstractExternalComponentTracer called ResponseTimeStats.recordResponseTime( getExclusiveDuration(), TimeUnit.NANOSECONDS), presumably to "enable" this "feature". So this method only exists in the bridge API to replicate the old behavior. More investigation is necessary. Use with care.- Specified by:
addExclusiveRollupMetricNamein interfaceTracedMethod- Parameters:
metricNameParts- The segments of the metric name. These values will be concatenated together separated by a `/` char.
-
setMetricNameFormatInfo
public void setMetricNameFormatInfo(java.lang.String metricName, java.lang.String transactionSegmentName, java.lang.String transactionSegmentUri)Description copied from interface:TracedMethodSets the traced method metric name, transaction segment name, and transaction segment URI.- Specified by:
setMetricNameFormatInfoin interfaceTracedMethod
-
isMetricProducer
public boolean isMetricProducer()
Description copied from interface:TracedMethodReturns true if this tracer produces a metric.- Specified by:
isMetricProducerin interfaceTracedMethod- Returns:
-
setCustomMetricPrefix
public void setCustomMetricPrefix(java.lang.String prefix)
Description copied from interface:TracedMethodSet the prefix for the metric name.- Specified by:
setCustomMetricPrefixin interfaceTracedMethod
-
setTrackChildThreads
public void setTrackChildThreads(boolean shouldTrack)
Description copied from interface:TracedMethodTell the tracer to track child async jobs which are submitted under its method call. This only applies to the scala instrumentation at the moment.- Specified by:
setTrackChildThreadsin interfaceTracedMethod
-
trackChildThreads
public boolean trackChildThreads()
- Specified by:
trackChildThreadsin interfaceTracedMethod
-
setTrackCallbackRunnable
public void setTrackCallbackRunnable(boolean shouldTrack)
Description copied from interface:TracedMethodTell the tracer to track child CallbackRunnable jobs which are submitted under its method call. This only applies to the Akka-Http instrumentation at the moment.- Specified by:
setTrackCallbackRunnablein interfaceTracedMethod
-
isTrackCallbackRunnable
public boolean isTrackCallbackRunnable()
- Specified by:
isTrackCallbackRunnablein interfaceTracedMethod
-
excludeLeaf
public void excludeLeaf()
Description copied from interface:TracedMethodMark a leaf tracer as excluded, similar to how excludeFromTransactionTrace works.- Specified by:
excludeLeafin interfaceTracedMethod
-
addOutboundRequestHeaders
public void addOutboundRequestHeaders(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
Description copied from interface:TracedMethodDo not use. UseTracedMethod.addOutboundRequestHeaders(OutboundHeaders)instead. To be called when performing an outbound external request using HTTP or JMS. This method must be called before any headers are written to the output stream. This method is generally used in conjunction with reportAsExternal.- Specified by:
addOutboundRequestHeadersin interfaceTracedMethod- Specified by:
addOutboundRequestHeadersin interfacecom.newrelic.api.agent.TracedMethod- Parameters:
outboundHeaders- The headers that will be written to the output stream for the external request. This also determines if the external call is HTTP or JMS.
-
readInboundResponseHeaders
public void readInboundResponseHeaders(com.newrelic.api.agent.InboundHeaders inboundResponseHeaders)
Description copied from interface:TracedMethodDo not use. There is no direct replacement. Use the public cross application tracing API if possible or use the bridge methodTransaction.provideHeaders(InboundHeaders)if necessary.- Specified by:
readInboundResponseHeadersin interfaceTracedMethod- Parameters:
inboundResponseHeaders- do not use.
-
reportAsExternal
public void reportAsExternal(com.newrelic.api.agent.ExternalParameters externalParameters)
- Specified by:
reportAsExternalin interfacecom.newrelic.api.agent.TracedMethod
-
reportAsExternal
public void reportAsExternal(ExternalParameters externalParameters)
- Specified by:
reportAsExternalin interfaceTracedMethod- Parameters:
externalParameters- The appropriate input parameters depending on the type external. Use thecom.newrelic.api.agent.ExternalParametersFactoryto create input parameters. For example,com.newrelic.api.agent.ExternalParametersFactory's createForDatastore to report this TracedMethod as a datastore.
-
-