use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class JaxRsTests method testTransactionNamePath.
@Test
public void testTransactionNamePath() {
assertEquals("Got it!", App.callClassResourceInTransaction());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/RestWebService/class (GET)";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.ClassResource/getIt").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class JaxRsTests method testTransactionNamePatch.
@Test
public void testTransactionNamePatch() {
assertEquals("Patched it!", App.callClassResourcePatchInTransaction());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/RestWebService/class (PATCH)";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.ClassResource/patchIt").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class JaxRsTests method testStaticEndpoint.
@Test
public void testStaticEndpoint() {
assertEquals("static endpoint was called", App.callStaticEndpoint());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/RestWebService/staticEndpoints/staticMethod (GET)";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.StaticEndpoint/staticMethod").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class JaxRsTests method testInnerClass.
@Test
public void testInnerClass() {
assertEquals("inner class endpoint was called", App.callInnerClass());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/RestWebService/inner/staticMethod (GET)";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.StaticEndpoint$InnerClass/innerStatic").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class HttpClient3Test method httpClient1.
@Test
public void httpClient1() throws IOException, URISyntaxException {
Introspector introspector = InstrumentationTestRunner.getIntrospector();
URI endpoint = server.getEndPoint();
execute1(endpoint);
Map<String, TracedMetricData> metrics = introspector.getMetricsForTransaction("OtherTransaction/Custom/com.nr.agent.instrumentation.httpclient.HttpClient3Test/execute1");
Assert.assertTrue(metrics.containsKey("External/" + endpoint.getHost() + "/CommonsHttp"));
metrics.get("External/" + endpoint.getHost() + "/CommonsHttp");
// execute1() calls execute() and releaseConnection(), both are instrumented
Assert.assertEquals(1, metrics.get("External/" + endpoint.getHost() + "/CommonsHttp/execute").getCallCount());
Assert.assertEquals(1, metrics.get("External/" + endpoint.getHost() + "/CommonsHttp").getCallCount());
}
Aggregations