use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class TransactionServiceTest method makeTransaction.
private static Tracer makeTransaction() {
Transaction tx = Transaction.getTransaction();
TransactionActivity txa = TransactionActivity.get();
assertNotNull(txa);
Tracer root = new OtherRootTracer(tx, new ClassMethodSignature("com.newrelic.agent.SegmentTest", "makeTransaction", "()V"), null, DefaultTracer.NULL_METRIC_NAME_FORMATTER);
txa.tracerStarted(root);
tx.setTransactionName(TransactionNamePriority.CUSTOM_HIGH, true, "Category", "TxName");
return root;
}
use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class TransactionStateImplTest method createRootTracer.
private Tracer createRootTracer() throws Exception {
Transaction tx = Transaction.getTransaction();
ClassMethodSignature sig = new ClassMethodSignature(getClass().getName(), "dude", "()V");
return new OtherRootTracer(tx, sig, this, new SimpleMetricNameFormat("test"));
}
use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class TransactionAsyncUtility method createOtherTracer.
// Create a Tracer for tests that require one.
public static OtherRootTracer createOtherTracer(String methodName) {
Transaction tx = Transaction.getTransaction();
ClassMethodSignature sig = new ClassMethodSignature("MyClass", methodName, "()V");
OtherRootTracer brrt = new OtherRootTracer(tx, sig, new Object(), new SimpleMetricNameFormat(methodName));
return brrt;
}
use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class RequestUriConfigTests method startTracer.
private DefaultTracer startTracer() throws SQLException {
DummyConnection conn = new DummyConnection();
Statement statement = conn.createStatement();
Transaction tx = Transaction.getTransaction();
ClassMethodSignature sig = new ClassMethodSignature("com.foo.Statement", "executeQuery", "(Ljava/lang/String;)Ljava/sql/ResultSet;");
DefaultTracer tracer = new OtherRootTracer(tx, sig, statement, new SimpleMetricNameFormat("metric", "segment", "some uri")) {
@Override
public long getDuration() {
return 100000;
}
};
tx.getTransactionActivity().tracerStarted(tracer);
return tracer;
}
use of com.newrelic.agent.tracers.OtherRootTracer in project newrelic-java-agent by newrelic.
the class CustomTracerFactoryTest method testNoTracerWithParent.
@Test
public void testNoTracerWithParent() {
Transaction transaction = Transaction.getTransaction();
transaction.getTransactionActivity().tracerStarted(new OtherRootTracer(transaction, signature, this, new SimpleMetricNameFormat("test")));
NoTracerMethodTracerFactory mtf = new NoTracerMethodTracerFactory();
CustomTracerFactory factory = new CustomTracerFactory(mtf);
Tracer tracer = factory.getTracer(transaction, signature, this, new Object[0]);
Assert.assertFalse(tracer instanceof TransactionActivityInitiator);
Assert.assertEquals(1, mtf.invocationCount);
}
Aggregations