Search in sources :

Example 41 with TracedMetricData

use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.

the class SqsClientTest method checkScopedMetricCount.

public static void checkScopedMetricCount(String transactionName, String metricName, int expected) {
    TracedMetricData data = InstrumentationTestRunner.getIntrospector().getMetricsForTransaction(transactionName).get(metricName);
    Assert.assertEquals(expected, data.getCallCount());
}
Also used : TracedMetricData(com.newrelic.agent.introspec.TracedMetricData)

Example 42 with TracedMetricData

use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.

the class JaxRsTests method testTransactionNamePost.

@Test
public void testTransactionNamePost() {
    assertEquals("Posted it!", App.callClassResourcePostInTransaction());
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    String expectedTransactionName = "OtherTransaction/RestWebService/class (POST)";
    Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
    assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.ClassResource/postIt").getCallCount());
}
Also used : TracedMetricData(com.newrelic.agent.introspec.TracedMetricData) Introspector(com.newrelic.agent.introspec.Introspector) Java7IncompatibleTest(com.newrelic.test.marker.Java7IncompatibleTest) Test(org.junit.Test)

Example 43 with TracedMetricData

use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.

the class JaxRsTests method testTransactionNameInterfaceWithImpl.

@Test
public void testTransactionNameInterfaceWithImpl() {
    assertEquals("Returning from getPeople", App.callInterfaceWithImplResourceInTransaction());
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    String expectedTransactionName = "OtherTransaction/RestWebService/v1/people/getPeople (GET)";
    Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
    assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.PeopleResource/getPeople").getCallCount());
}
Also used : TracedMetricData(com.newrelic.agent.introspec.TracedMetricData) Introspector(com.newrelic.agent.introspec.Introspector) Java7IncompatibleTest(com.newrelic.test.marker.Java7IncompatibleTest) Test(org.junit.Test)

Example 44 with TracedMetricData

use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.

the class JaxRsTests method testTransactionNamePut.

@Test
public void testTransactionNamePut() {
    assertEquals("Put it!", App.callClassResourcePutInTransaction());
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    String expectedTransactionName = "OtherTransaction/RestWebService/class (PUT)";
    Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
    assertEquals(1, metricsForTransaction.get("Java/com.nr.instrumentation.javax.ws.rs.api.ClassResource/putIt").getCallCount());
}
Also used : TracedMetricData(com.newrelic.agent.introspec.TracedMetricData) Introspector(com.newrelic.agent.introspec.Introspector) Java7IncompatibleTest(com.newrelic.test.marker.Java7IncompatibleTest) Test(org.junit.Test)

Example 45 with TracedMetricData

use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.

the class JaxRsTests method testTransactionNameClassException.

@Test
public void testTransactionNameClassException() {
    assertEquals("Got it!", App.callExceptionClassResourceInTransaction());
    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/exceptionTest").getCallCount());
}
Also used : TracedMetricData(com.newrelic.agent.introspec.TracedMetricData) Introspector(com.newrelic.agent.introspec.Introspector) Java7IncompatibleTest(com.newrelic.test.marker.Java7IncompatibleTest) Test(org.junit.Test)

Aggregations

TracedMetricData (com.newrelic.agent.introspec.TracedMetricData)65 Test (org.junit.Test)58 Introspector (com.newrelic.agent.introspec.Introspector)51 Java7IncompatibleTest (com.newrelic.test.marker.Java7IncompatibleTest)15 URI (java.net.URI)12 TransactionEvent (com.newrelic.agent.introspec.TransactionEvent)10 ExternalRequest (com.newrelic.agent.introspec.ExternalRequest)7 Tracer (com.newrelic.agent.tracers.Tracer)7 TransactionTrace (com.newrelic.agent.introspec.TransactionTrace)6 AMQP (com.rabbitmq.client.AMQP)6 DefaultConsumer (com.rabbitmq.client.DefaultConsumer)6 Envelope (com.rabbitmq.client.Envelope)6 IOException (java.io.IOException)6 ActorSystem (akka.actor.ActorSystem)5 DefaultTracer (com.newrelic.agent.tracers.DefaultTracer)4 OtherRootTracer (com.newrelic.agent.tracers.OtherRootTracer)4 Vertx (io.vertx.core.Vertx)4 HttpServer (io.vertx.core.http.HttpServer)4 TraceSegment (com.newrelic.agent.introspec.TraceSegment)3 Trace (com.newrelic.api.agent.Trace)3