Search in sources :

Example 1 with ForwardActor

use of com.nr.instrumentation.akka22.test.actors.forwarding.ForwardActor in project newrelic-java-agent by newrelic.

the class AkkaTest method testSend.

@Test
public void testSend() throws InterruptedException {
    ActorSystem system = ActorSystem.create("AkkaTestSystem");
    TestApp.sendMessageInTransaction(system);
    Introspector introspector = InstrumentationTestRunner.getIntrospector();
    int finishedTransactionCount = introspector.getFinishedTransactionCount(5000);
    assertEquals(1, finishedTransactionCount);
    String transactionName = "OtherTransaction/AkkaForward/Forward";
    Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(transactionName);
    assertTrue(metricsForTransaction.containsKey("Akka/forward/forwardActor"));
    assertTrue(metricsForTransaction.containsKey("Akka/receive/" + ForwardActor.class.getName()));
}
Also used : ActorSystem(akka.actor.ActorSystem) ForwardActor(com.nr.instrumentation.akka22.test.actors.forwarding.ForwardActor) TracedMetricData(com.newrelic.agent.introspec.TracedMetricData) Introspector(com.newrelic.agent.introspec.Introspector) Test(org.junit.Test)

Aggregations

ActorSystem (akka.actor.ActorSystem)1 Introspector (com.newrelic.agent.introspec.Introspector)1 TracedMetricData (com.newrelic.agent.introspec.TracedMetricData)1 ForwardActor (com.nr.instrumentation.akka22.test.actors.forwarding.ForwardActor)1 Test (org.junit.Test)1