Search in sources :

Example 1 with TransactionApiImpl

use of com.newrelic.agent.TransactionApiImpl in project newrelic-java-agent by newrelic.

the class CircuitBreakerServiceFunctionalTest method aTransaction.

@Trace(dispatcher = true)
private void aTransaction(boolean breakerTripped) {
    Transaction transaction = NewRelic.getAgent().getTransaction();
    InstrumentationImpl impl = new InstrumentationImpl(Agent.LOG);
    if (breakerTripped) {
        ExitTracer createdTracer = impl.createTracer(null, 0, "metricName", TracerFlags.DISPATCHER);
        Assert.assertNull(createdTracer);
        Assert.assertTrue(transaction instanceof NoOpTransaction);
    } else {
        Assert.assertTrue(transaction instanceof TransactionApiImpl);
    }
}
Also used : ExitTracer(com.newrelic.agent.bridge.ExitTracer) NoOpTransaction(com.newrelic.agent.bridge.NoOpTransaction) Transaction(com.newrelic.api.agent.Transaction) InstrumentationImpl(com.newrelic.agent.instrumentation.InstrumentationImpl) TransactionApiImpl(com.newrelic.agent.TransactionApiImpl) NoOpTransaction(com.newrelic.agent.bridge.NoOpTransaction) Trace(com.newrelic.api.agent.Trace)

Aggregations

TransactionApiImpl (com.newrelic.agent.TransactionApiImpl)1 ExitTracer (com.newrelic.agent.bridge.ExitTracer)1 NoOpTransaction (com.newrelic.agent.bridge.NoOpTransaction)1 InstrumentationImpl (com.newrelic.agent.instrumentation.InstrumentationImpl)1 Trace (com.newrelic.api.agent.Trace)1 Transaction (com.newrelic.api.agent.Transaction)1