use of com.nr.instrumentation.akka22.test.actors.routing.Routee in project newrelic-java-agent by newrelic.
the class AkkaTest method testRoutedActorToRouteeSend.
@Test
public void testRoutedActorToRouteeSend() throws InterruptedException {
ActorSystem system = ActorSystem.create("AkkaTestSystem");
TestApp.sendRoutedMessageToRouteeInTransaction(system);
Introspector introspector = InstrumentationTestRunner.getIntrospector();
int finishedTransactionCount = introspector.getFinishedTransactionCount(5000);
assertEquals(1, finishedTransactionCount);
String transactionName = "OtherTransaction/Akka/Routee";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(transactionName);
assertTrue(metricsForTransaction.containsKey("Akka/receive/" + RoutingActor.class.getName()));
assertTrue(metricsForTransaction.containsKey("Akka/receive/" + Routee.class.getName()));
}
use of com.nr.instrumentation.akka22.test.actors.routing.Routee in project newrelic-java-agent by newrelic.
the class TestApp method sendRoutedMessageToRouteeInTransaction.
@Trace(dispatcher = true)
public static void sendRoutedMessageToRouteeInTransaction(ActorSystem system) throws InterruptedException {
final ActorRef routee = system.actorOf(Props.create(Routee.class));
ActorRef router = system.actorOf(new RoundRobinPool(5).props(Props.create(RoutingActor.class, routee)));
// Let system initialize
Thread.sleep(2000);
router.tell("routing", null);
// Let message processing finish
Thread.sleep(2000);
}
Aggregations