use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class JerseyTests method syncEndpointWithIOExceptionTest.
@Test
public void syncEndpointWithIOExceptionTest() {
Response response = getRequest("/api/async/syncEndpointWithIOException", server.getURI().getPort());
assertNotNull(response);
assertEquals(500, response.statusCode());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
int finishedTransactionCount = introspector.getFinishedTransactionCount(TIMEOUT);
assertEquals(1, finishedTransactionCount);
String transactionName = introspector.getTransactionNames().toArray()[0].toString();
assertNotNull(transactionName);
assertEquals("WebTransaction/AsyncResource/syncEndpointWithIOException", transactionName);
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class JerseyTests method asyncTimeoutTestThrowable.
@Test
public void asyncTimeoutTestThrowable() {
Response response = getRequest("/api/async/timeoutThrowable", server.getURI().getPort());
assertNotNull(response);
assertEquals(500, response.statusCode());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
int finishedTransactionCount = introspector.getFinishedTransactionCount(TIMEOUT);
assertEquals(1, finishedTransactionCount);
String transactionName = introspector.getTransactionNames().toArray()[0].toString();
assertNotNull(transactionName);
assertEquals("WebTransaction/AsyncResource/timeoutThrowable", transactionName);
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class JerseyClientTest method testHttpMethods.
@Test
public void testHttpMethods() throws Exception {
Introspector introspector = InstrumentationTestRunner.getIntrospector();
URI endpoint = server.getEndPoint();
requestHttpMethods(endpoint.toURL().toString());
// transaction
String txName = "OtherTransaction/Custom/com.nr.agent.instrumentation.jerseyclient.JerseyClientTest/requestHttpMethods";
assertEquals(1, introspector.getFinishedTransactionCount(3000));
Collection<String> names = introspector.getTransactionNames();
assertTrue(names.contains(txName));
// external request test should go here
Collection<ExternalRequest> externalRequests = InstrumentationTestRunner.getIntrospector().getExternalRequests(txName);
assertEquals(4, externalRequests.size());
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/localhost/all"));
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/allOther"));
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/all"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class MariaDbTest method testPreparedStatementQuery.
@Test
@Ignore
public void testPreparedStatementQuery() throws Exception {
mariaDbPreparedStatementQuery();
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount());
DatastoreHelper helper = new DatastoreHelper("MySQL");
helper.assertAggregateMetrics();
helper.assertUnscopedOperationMetricCount("select", 1);
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class Jersey2ClientTest method testHttpMethods.
@Test
public void testHttpMethods() throws Exception {
Introspector introspector = InstrumentationTestRunner.getIntrospector();
URI endpoint = server.getEndPoint();
requestHttpMethods(endpoint.toURL().toString());
// transaction
String txName = "OtherTransaction/Custom/com.nr.agent.instrumentation.jerseyclient2.Jersey2ClientTest/requestHttpMethods";
assertEquals(1, introspector.getFinishedTransactionCount(3000));
assertTrue(introspector.getTransactionNames().contains(txName));
// external request test should go here
Collection<ExternalRequest> externalRequests = introspector.getExternalRequests(txName);
assertEquals(4, externalRequests.size());
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/localhost/all"));
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/allOther"));
assertEquals(4, MetricsHelper.getUnscopedMetricCount("External/all"));
}
Aggregations