use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testRestPathRoute.
@Test
public void testRestPathRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/restpath/rest").then().body(containsString("RestPath: rest"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/restpath/RestPath"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testAlternateSegmentFutureRoute.
@Test
public void testAlternateSegmentFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/segment/future/food100").then().body(containsString("Segment Future: d100"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().contains(getTransactionPrefix() + "/segment/future/foo~Segment"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testMapRoute.
@Test
public void testMapRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/map/red").then().body(containsString("Map: 1"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/map/red"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testAlternateRestFutureRoute.
@Test
public void testAlternateRestFutureRoute() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/futurerest/this/is/the/rest").then().body(containsString("FutureRest: /this/is/the/rest"));
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(getTransactionPrefix() + "/futurerest~Rest"));
}
use of com.newrelic.agent.introspec.Introspector in project newrelic-java-agent by newrelic.
the class SprayHttpRoutesTest method testNoMGI.
@Test
public void testNoMGI() {
given().baseUri("http://localhost:" + server.getPort()).when().get("/prefix-first").then().body(containsString("prefix-first"));
String expectedTransactionName = getTransactionPrefix() + "/prefix-first";
Introspector introspector = InstrumentationTestRunner.getIntrospector();
Assert.assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_MILLIS));
Assert.assertTrue(introspector.getTransactionNames().toString(), introspector.getTransactionNames().contains(expectedTransactionName));
Map<String, TracedMetricData> metricsForTransaction = introspector.getMetricsForTransaction(expectedTransactionName);
Assert.assertTrue(metricsForTransaction.containsKey("Akka/temp/tell/akka.io.TcpIncomingConnection"));
Assert.assertTrue(metricsForTransaction.containsKey("Akka/temp/tell/spray.can.server.HttpServerConnection"));
Pattern pattern = Pattern.compile("Akka/\\d+/tell");
Matcher matcher = pattern.matcher("");
for (String metricName : metricsForTransaction.keySet()) {
matcher.reset(metricName);
Assert.assertFalse(matcher.find());
}
}
Aggregations