use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class PostgresqlNoInstrumentationTest method testBasicRequests.
@Test
public void testBasicRequests() {
// Given
Introspector introspector = InstrumentationTestRunner.getIntrospector();
DatastoreHelper helper = new DatastoreHelper("Postgres");
// When
R2dbcTestUtils.basicRequests(connection);
// Then
assertEquals(1, introspector.getFinishedTransactionCount(1000));
assertEquals(1, introspector.getTransactionNames().size());
String transactionName = introspector.getTransactionNames().stream().findFirst().orElse("");
helper.assertScopedStatementMetricCount(transactionName, "INSERT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "SELECT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "UPDATE", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "DELETE", "USERS", 0);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class MySQLInstrumentedTest method testBasicRequests.
@Test
public void testBasicRequests() {
// Given
Introspector introspector = InstrumentationTestRunner.getIntrospector();
DatastoreHelper helper = new DatastoreHelper("MySQL");
// When
R2dbcTestUtils.basicRequests(connection);
// Then
assertEquals(1, introspector.getFinishedTransactionCount(1000));
assertEquals(1, introspector.getTransactionNames().size());
String transactionName = introspector.getTransactionNames().stream().findFirst().orElse("");
helper.assertScopedStatementMetricCount(transactionName, "INSERT", "USERS", 1);
helper.assertScopedStatementMetricCount(transactionName, "SELECT", "USERS", 3);
helper.assertScopedStatementMetricCount(transactionName, "UPDATE", "USERS", 1);
helper.assertScopedStatementMetricCount(transactionName, "DELETE", "USERS", 1);
helper.assertAggregateMetrics();
helper.assertUnscopedOperationMetricCount("INSERT", 1);
helper.assertUnscopedOperationMetricCount("SELECT", 3);
helper.assertUnscopedOperationMetricCount("UPDATE", 1);
helper.assertUnscopedOperationMetricCount("DELETE", 1);
helper.assertUnscopedStatementMetricCount("INSERT", "USERS", 1);
helper.assertUnscopedStatementMetricCount("SELECT", "USERS", 3);
helper.assertUnscopedStatementMetricCount("UPDATE", "USERS", 1);
helper.assertUnscopedStatementMetricCount("DELETE", "USERS", 1);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class MySQLNoInstrumentationTest method testBasicRequests.
@Test
public void testBasicRequests() {
// Given
Introspector introspector = InstrumentationTestRunner.getIntrospector();
DatastoreHelper helper = new DatastoreHelper("MySQL");
// When
R2dbcTestUtils.basicRequests(connection);
// Then
assertEquals(1, introspector.getFinishedTransactionCount(1000));
assertEquals(1, introspector.getTransactionNames().size());
String transactionName = introspector.getTransactionNames().stream().findFirst().orElse("");
helper.assertScopedStatementMetricCount(transactionName, "INSERT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "SELECT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "UPDATE", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "DELETE", "USERS", 0);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class MySQLNoInstrumentationTest method testParametrizedRequests.
@Test
public void testParametrizedRequests() {
// Given
Introspector introspector = InstrumentationTestRunner.getIntrospector();
DatastoreHelper helper = new DatastoreHelper("MySQL");
// When
R2dbcTestUtils.parametrizedRequests(connection);
// Then
assertEquals(1, introspector.getFinishedTransactionCount(1000));
assertEquals(1, introspector.getTransactionNames().size());
String transactionName = introspector.getTransactionNames().stream().findFirst().orElse("");
helper.assertScopedStatementMetricCount(transactionName, "INSERT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "SELECT", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "UPDATE", "USERS", 0);
helper.assertScopedStatementMetricCount(transactionName, "DELETE", "USERS", 0);
}
Aggregations