use of com.netflix.spectator.aws.SpectatorMetricCollector in project iep by Netflix.
the class AwsMetricsModuleTest method withRegistryBinding.
@Test
public void withRegistryBinding() {
AwsSdkMetrics.setMetricCollector(null);
Assert.assertFalse(AwsSdkMetrics.getMetricCollector() instanceof SpectatorMetricCollector);
final Registry registry = new DefaultRegistry();
Guice.createInjector(new AwsMetricsModule(), new AbstractModule() {
@Override
protected void configure() {
bind(Registry.class).toInstance(registry);
}
});
Assert.assertTrue(AwsSdkMetrics.getMetricCollector() instanceof SpectatorMetricCollector);
}
use of com.netflix.spectator.aws.SpectatorMetricCollector in project kork by spinnaker.
the class AwsComponents method spectatorMetricsCollector.
@Bean
@ConditionalOnProperty(value = "aws.metrics.enabled", matchIfMissing = true)
SpectatorMetricCollector spectatorMetricsCollector(Registry registry) {
SpectatorMetricCollector collector = new SpectatorMetricCollector(registry);
AwsSdkMetrics.setMetricCollector(collector);
return collector;
}
Aggregations