use of com.nr.instrumentation.akka22.test.actors.broadcasting.ActorA in project newrelic-java-agent by newrelic.
the class AkkaTest method testBroadcast.
@Test
public void testBroadcast() throws InterruptedException {
ActorSystem system = ActorSystem.create("AkkaTestSystem");
TestApp.broadcastInTransaction(system);
Introspector introspector = InstrumentationTestRunner.getIntrospector();
int finishedTransactionCount = introspector.getFinishedTransactionCount(5000);
assertEquals(1, finishedTransactionCount);
String transactionName = "OtherTransaction/Akka/Broadcast";
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(transactionName);
assertTrue(metricsForTransaction.containsKey("Akka/receive/" + ActorA.class.getName()));
assertTrue(metricsForTransaction.containsKey("Akka/receive/" + ActorB.class.getName()));
assertTrue(metricsForTransaction.containsKey("Akka/receive/" + ActorC.class.getName()));
Map<String, TracedMetricData> unscopedMetrics = introspector.getUnscopedMetrics();
assertTrue(unscopedMetrics.containsKey("ActorA"));
assertTrue(unscopedMetrics.containsKey("ActorB"));
assertTrue(unscopedMetrics.containsKey("ActorC"));
}
use of com.nr.instrumentation.akka22.test.actors.broadcasting.ActorA in project newrelic-java-agent by newrelic.
the class TestApp method broadcastInTransaction.
@Trace(dispatcher = true)
public static void broadcastInTransaction(ActorSystem system) throws InterruptedException {
ActorRef actorA = system.actorOf(Props.create(ActorA.class));
ActorRef actorB = system.actorOf(Props.create(ActorB.class));
ActorRef actorC = system.actorOf(Props.create(ActorC.class));
// Let system initialize
Thread.sleep(1000);
system.actorSelection("/user/*").tell("message", null);
// Let all actors process messages
Thread.sleep(2000);
}
Aggregations