use of com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider in project data-prepper by opensearch-project.
the class MetricsConfigTest method testGivenConfigWithCloudWatchMeterRegistryThenNoMeterRegistryCreated.
@Test
public void testGivenConfigWithCloudWatchMeterRegistryThenNoMeterRegistryCreated() {
final CloudWatchMeterRegistryProvider provider = mock(CloudWatchMeterRegistryProvider.class);
final CloudWatchMeterRegistry expected = mock(CloudWatchMeterRegistry.class);
final MeterRegistry.Config config = mock(MeterRegistry.Config.class);
final DataPrepperConfiguration dataPrepperConfiguration = mock(DataPrepperConfiguration.class);
when(provider.getCloudWatchMeterRegistry()).thenReturn(expected);
when(expected.config()).thenReturn(config);
when(dataPrepperConfiguration.getMetricRegistryTypes()).thenReturn(Collections.singletonList(MetricRegistryType.CloudWatch));
final MeterRegistry meterRegistry = metricsConfig.cloudWatchMeterRegistry(dataPrepperConfiguration, provider);
assertThat(meterRegistry, is(expected));
}
use of com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider in project data-prepper by opensearch-project.
the class CloudWatchMeterRegistryProviderTest method testCreateCloudWatchMeterRegistry.
@Test
public void testCreateCloudWatchMeterRegistry() {
final CloudWatchMeterRegistryProvider cloudWatchMeterRegistryProvider = new CloudWatchMeterRegistryProvider(TEST_CLOUDWATCH_PROPERTIES, cloudWatchAsyncClient);
final CloudWatchMeterRegistry cloudWatchMeterRegistry = cloudWatchMeterRegistryProvider.getCloudWatchMeterRegistry();
assertThat(cloudWatchMeterRegistry, notNullValue());
}
Aggregations