Java 类org.springframework.boot.actuate.metrics.dropwizard.DropwizardMetricServices 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void dropwizardInstalledIfPresent() {
    this.context = new AnnotationConfigApplicationContext(
            MetricsDropwizardAutoConfiguration.class,
            MetricRepositoryAutoConfiguration.class, AopAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(GaugeService.class);
    assertThat(gaugeService).isNotNull();
    gaugeService.submit("foo", 2.7);
    DropwizardMetricServices exporter = this.context
            .getBean(DropwizardMetricServices.class);
    assertThat(exporter).isEqualTo(gaugeService);
    MetricRegistry registry = this.context.getBean(MetricRegistry.class);
    @SuppressWarnings("unchecked")
    Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
    assertThat(gauge.getValue()).isEqualTo(new Double(2.7));
}
项目:spring-boot-concourse    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void dropwizardInstalledIfPresent() {
    this.context = new AnnotationConfigApplicationContext(
            MetricsDropwizardAutoConfiguration.class,
            MetricRepositoryAutoConfiguration.class, AopAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(GaugeService.class);
    assertThat(gaugeService).isNotNull();
    gaugeService.submit("foo", 2.7);
    DropwizardMetricServices exporter = this.context
            .getBean(DropwizardMetricServices.class);
    assertThat(exporter).isEqualTo(gaugeService);
    MetricRegistry registry = this.context.getBean(MetricRegistry.class);
    @SuppressWarnings("unchecked")
    Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
    assertThat(gauge.getValue()).isEqualTo(new Double(2.7));
}
项目:contestparser    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void dropwizardInstalledIfPresent() {
    this.context = new AnnotationConfigApplicationContext(
            MetricsDropwizardAutoConfiguration.class,
            MetricRepositoryAutoConfiguration.class, AopAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(GaugeService.class);
    assertNotNull(gaugeService);
    gaugeService.submit("foo", 2.7);
    DropwizardMetricServices exporter = this.context
            .getBean(DropwizardMetricServices.class);
    assertEquals(gaugeService, exporter);
    MetricRegistry registry = this.context.getBean(MetricRegistry.class);
    @SuppressWarnings("unchecked")
    Gauge<Double> gauge = (Gauge<Double>) registry.getMetrics().get("gauge.foo");
    assertEquals(new Double(2.7), gauge.getValue());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricsDropwizardAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ DropwizardMetricServices.class, CounterService.class,
        GaugeService.class })
public DropwizardMetricServices dropwizardMetricServices(
        MetricRegistry metricRegistry) {
    return new DropwizardMetricServices(metricRegistry);
}
项目:spring-boot-concourse    文件:MetricsDropwizardAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ DropwizardMetricServices.class, CounterService.class,
        GaugeService.class })
public DropwizardMetricServices dropwizardMetricServices(
        MetricRegistry metricRegistry) {
    return new DropwizardMetricServices(metricRegistry);
}
项目:contestparser    文件:MetricsDropwizardAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean({ DropwizardMetricServices.class, CounterService.class,
        GaugeService.class })
public DropwizardMetricServices dropwizardMetricServices(
        MetricRegistry metricRegistry) {
    return new DropwizardMetricServices(metricRegistry);
}
项目:ontrack    文件:DefaultMetricsExporter.java   
@Autowired
public DefaultMetricsExporter(OntrackConfigProperties config, DropwizardMetricServices metricWriter, Collection<MetricsSource> metricsSources) {
    super("");
    this.config = config;
    this.metricWriter = metricWriter;
    this.metricsSources = metricsSources;
    this.executor = Executors.newSingleThreadScheduledExecutor(
            new ThreadFactoryBuilder()
                    .setDaemon(true)
                    .setNameFormat("metrics-exporter-%d")
                    .build()
    );
}
项目:secrets-proxy    文件:MetricsUtilService.java   
public MetricsUtilService(DropwizardMetricServices metricService) {
    this.metricService = metricService;
}
项目:secrets-proxy    文件:UserRepository.java   
public UserRepository(DSLContext dslContext, DropwizardMetricServices metricService) {
    this.dslContext = dslContext;
    this.metricService = metricService;
}
项目:xlator    文件:Application.java   
@Bean
RedisCacheMonitor cacheMonitor(RedisConnectionFactory redisConnectionFactory,
        DropwizardMetricServices metricServices) {
    return new RedisCacheMonitor(redisConnectionFactory, metricServices);
}
项目:xlator    文件:RedisCacheMonitor.java   
public RedisCacheMonitor(RedisConnectionFactory redisConnectionFactory, DropwizardMetricServices metricServices) {
    this.redisConnectionFactory = redisConnectionFactory;
    this.metricServices = metricServices;
}
项目:ontrack    文件:WebTestConfig.java   
@Bean
public DropwizardMetricServices dropwizardMetricServices() {
    return new DropwizardMetricServices(metricRegistry);
}