Search in sources :

Example 1 with NoOpSegment

use of com.newrelic.agent.bridge.NoOpSegment in project newrelic-java-agent by newrelic.

the class FlyweightTracerTest method tracedActivityFromFlyweight.

@Trace(excludeFromTransactionTrace = true, leaf = true)
private void tracedActivityFromFlyweight() {
    // When you are in a flyweight method you should not be allowed to start a traced activity due to the
    // fact that we have no real parent tracer to tie the tracer to. We can revisit this in the future if need be
    // but it would require a significant number of changes to the agent
    TracedActivity tracedActivity = AgentBridge.getAgent().getTransaction().createAndStartTracedActivity();
    Assert.assertTrue(tracedActivity instanceof NoOpSegment);
}
Also used : NoOpSegment(com.newrelic.agent.bridge.NoOpSegment) TracedActivity(com.newrelic.agent.bridge.TracedActivity) Trace(com.newrelic.api.agent.Trace)

Aggregations

NoOpSegment (com.newrelic.agent.bridge.NoOpSegment)1 TracedActivity (com.newrelic.agent.bridge.TracedActivity)1 Trace (com.newrelic.api.agent.Trace)1