use of com.newrelic.agent.introspec.TracedMetricData 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());
}
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class SpringControllerTests method testPathAndValue.
@Test
public void testPathAndValue() {
assertEquals("pathAndValue", App.pathAndValue());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/SpringController/path/value (GET)";
Map<String, TracedMetricData> metrics = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metrics.get("Java/com.nr.agent.instrumentation.PathAndValueTest/pathAndValue").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class SpringControllerTests method testKotlinDefaultParameter.
@Test
public void testKotlinDefaultParameter() {
assertEquals("kotlinDefaultParameter", App.kotlinDefaultParameter());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/SpringController/kotlin/read (GET)";
Map<String, TracedMetricData> metrics = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metrics.get("Java/com.nr.agent.instrumentation.KotlinSpringClass/read").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class SpringControllerTests method testInnerPath.
@Test
public void testInnerPath() {
assertEquals("innerPath", App.innerPath());
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/SpringController/defaultPath/innerPath (GET)";
Map<String, TracedMetricData> metrics = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metrics.get("Java/com.nr.agent.instrumentation.TestInnerAndDefaultPath/testInnerPath").getCallCount());
}
use of com.newrelic.agent.introspec.TracedMetricData in project newrelic-java-agent by newrelic.
the class SpringControllerTests method checkVerb.
public void checkVerb(String path, String method, String verb) {
Introspector introspector = InstrumentationTestRunner.getIntrospector();
String expectedTransactionName = "OtherTransaction/SpringController/verb/" + path + " (" + verb + ")";
Map<String, TracedMetricData> metrics = introspector.getMetricsForTransaction(expectedTransactionName);
assertEquals(1, metrics.get("Java/com.nr.agent.instrumentation.VerbTests/" + method).getCallCount());
}
Aggregations