Class NoOpSegment

  • All Implemented Interfaces:
    TracedActivity, com.newrelic.api.agent.AttributeHolder, com.newrelic.api.agent.Segment

    public class NoOpSegment
    extends java.lang.Object
    implements TracedActivity
    • Field Detail

    • Method Detail

      • getTracedMethod

        public TracedMethod getTracedMethod()
        Description copied from interface: TracedActivity
        Returns the underlying TracedMethod of this activity. Normal api calls (e.g. Datastore, external) can be applied to the returned traced method as long as the activity is not finished.
        Specified by:
        getTracedMethod in interface TracedActivity
      • setAsyncThreadName

        public void setAsyncThreadName​(java.lang.String threadName)
        Description copied from interface: TracedActivity
        This method has been deprecated as it does not do what it was originally intended to do. Functionally it is a NoOp method.
        Specified by:
        setAsyncThreadName in interface TracedActivity
      • ignoreIfUnfinished

        public void ignoreIfUnfinished()
        Description copied from interface: TracedActivity
        Do not report this activity in its parent transaction. Has no effect if the activity is finished.
        Specified by:
        ignoreIfUnfinished in interface TracedActivity
      • finish

        public void finish()
        Description copied from interface: TracedActivity
        Stop timing the activity. Only the first call to this method will have an effect.
        Specified by:
        finish in interface TracedActivity
      • finish

        public void finish​(java.lang.Throwable t)
        Description copied from interface: TracedActivity
        Stop timing the activity. Only the first call to this method will have an effect.
        Specified by:
        finish in interface TracedActivity
        Parameters:
        t - an error to pass to the agent. Note that this error is not automatically reported to APM.
      • setMetricName

        public void setMetricName​(java.lang.String... metricNameParts)
        Specified by:
        setMetricName in interface com.newrelic.api.agent.Segment
      • reportAsExternal

        public void reportAsExternal​(com.newrelic.api.agent.ExternalParameters externalParameters)
        Specified by:
        reportAsExternal in interface com.newrelic.api.agent.Segment
      • addOutboundRequestHeaders

        public void addOutboundRequestHeaders​(com.newrelic.api.agent.OutboundHeaders outboundHeaders)
        Specified by:
        addOutboundRequestHeaders in interface com.newrelic.api.agent.Segment
      • getTransaction

        public com.newrelic.api.agent.Transaction getTransaction()
        Specified by:
        getTransaction in interface com.newrelic.api.agent.Segment
      • ignore

        public void ignore()
        Specified by:
        ignore in interface com.newrelic.api.agent.Segment
      • end

        public void end()
        Specified by:
        end in interface com.newrelic.api.agent.Segment
      • endAsync

        public void endAsync()
        Specified by:
        endAsync in interface com.newrelic.api.agent.Segment
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       java.lang.Number value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       java.lang.String value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttribute

        public void addCustomAttribute​(java.lang.String key,
                                       boolean value)
        Specified by:
        addCustomAttribute in interface com.newrelic.api.agent.AttributeHolder
      • addCustomAttributes

        public void addCustomAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Specified by:
        addCustomAttributes in interface com.newrelic.api.agent.AttributeHolder