use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class DefaultDynamoDbClient_InstrumentationTest method assertScopedStatementMetric.
private void assertScopedStatementMetric(String operation, String collection) {
Introspector introspector = InstrumentationTestRunner.getIntrospector();
assertEquals(1, introspector.getFinishedTransactionCount(DEFAULT_TIMEOUT_IN_MILLIS));
String txName = introspector.getTransactionNames().iterator().next();
DatastoreHelper helper = new DatastoreHelper(DYNAMODB_PRODUCT);
helper.assertAggregateMetrics();
helper.assertScopedStatementMetricCount(txName, operation, collection, 1);
helper.assertInstanceLevelMetric(DYNAMODB_PRODUCT, dynamoDb.getHostName(), dynamoDb.getPort());
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class DynamoApiTest method testCreateTable.
@Test
public void testCreateTable() {
createTableTxn();
Introspector introspector = InstrumentationTestRunner.getIntrospector();
assertEquals(1, introspector.getFinishedTransactionCount(10000));
String txName = introspector.getTransactionNames().iterator().next();
DatastoreHelper helper = new DatastoreHelper(DYNAMODB_PRODUCT);
helper.assertScopedStatementMetricCount(txName, "createTable", TABLE_NAME, 1);
helper.assertInstanceLevelMetric(DYNAMODB_PRODUCT, hostName, port);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class DynamoApiTest method testPutAndGetItemAsync.
@Test
public void testPutAndGetItemAsync() throws ExecutionException, InterruptedException {
putAndGetTxnAsync();
Introspector introspector = InstrumentationTestRunner.getIntrospector();
assertEquals(1, introspector.getFinishedTransactionCount(10000));
String txName = introspector.getTransactionNames().iterator().next();
DatastoreHelper helper = new DatastoreHelper(DYNAMODB_PRODUCT);
helper.assertScopedStatementMetricCount(txName, "putItem", TABLE_NAME, 1);
helper.assertScopedStatementMetricCount(txName, "getItem", TABLE_NAME, 1);
helper.assertAggregateMetrics();
helper.assertInstanceLevelMetric(DYNAMODB_PRODUCT, hostName, port);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class DynamoApiTest method testCreateTableAsync.
@Test
public void testCreateTableAsync() throws InterruptedException, ExecutionException, TimeoutException {
createTableAsyncTxn();
Introspector introspector = InstrumentationTestRunner.getIntrospector();
assertEquals(1, introspector.getFinishedTransactionCount(10000));
String txName = introspector.getTransactionNames().iterator().next();
DatastoreHelper helper = new DatastoreHelper(DYNAMODB_PRODUCT);
helper.assertScopedStatementMetricCount(txName, "createTable", ASYNC_TABLE_NAME, 1);
helper.assertInstanceLevelMetric(DYNAMODB_PRODUCT, hostName, port);
}
use of com.newrelic.agent.introspec.DatastoreHelper in project newrelic-java-agent by newrelic.
the class DynamoApiTest method testDescribeTableAsync.
@Test
public void testDescribeTableAsync() {
describeTableTxnAsync();
Introspector introspector = InstrumentationTestRunner.getIntrospector();
assertEquals(1, introspector.getFinishedTransactionCount(10000));
String txName = introspector.getTransactionNames().iterator().next();
DatastoreHelper helper = new DatastoreHelper(DYNAMODB_PRODUCT);
helper.assertScopedStatementMetricCount(txName, "describeTable", ASYNC_TABLE_NAME, 1);
helper.assertAggregateMetrics();
helper.assertInstanceLevelMetric(DYNAMODB_PRODUCT, hostName, port);
}
Aggregations