Java 类org.springframework.boot.actuate.endpoint.MetricsEndpointMetricReader 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricExportAutoConfiguration.java   
public MetricExportAutoConfiguration(MetricExportProperties properties,
        ObjectProvider<MetricsEndpointMetricReader> endpointReaderProvider,
        @ExportMetricReader ObjectProvider<List<MetricReader>> readersProvider,
        @ExportMetricWriter ObjectProvider<Map<String, GaugeWriter>> writersProvider,
        ObjectProvider<Map<String, Exporter>> exportersProvider) {
    this.properties = properties;
    this.endpointReader = endpointReaderProvider.getIfAvailable();
    this.readers = readersProvider.getIfAvailable();
    this.writers = writersProvider.getIfAvailable();
    this.exporters = exportersProvider.getIfAvailable();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricExportAutoConfigurationTests.java   
@Test
public void exportMetricsEndpoint() {
    this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
            MetricEndpointConfiguration.class, MetricExportAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    MetricExporters exporters = this.context.getBean(MetricExporters.class);
    MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters()
            .get("writer");
    exporter.setIgnoreTimestamps(true);
    exporter.export();
    MetricsEndpointMetricReader reader = this.context.getBean("endpointReader",
            MetricsEndpointMetricReader.class);
    Mockito.verify(reader, Mockito.atLeastOnce()).findAll();
}
项目:spring-boot-concourse    文件:MetricExportAutoConfiguration.java   
public MetricExportAutoConfiguration(MetricExportProperties properties,
        ObjectProvider<MetricsEndpointMetricReader> endpointReaderProvider,
        @ExportMetricReader ObjectProvider<List<MetricReader>> readersProvider,
        @ExportMetricWriter ObjectProvider<Map<String, GaugeWriter>> writersProvider,
        ObjectProvider<Map<String, Exporter>> exportersProvider) {
    this.properties = properties;
    this.endpointReader = endpointReaderProvider.getIfAvailable();
    this.readers = readersProvider.getIfAvailable();
    this.writers = writersProvider.getIfAvailable();
    this.exporters = exportersProvider.getIfAvailable();
}
项目:spring-boot-concourse    文件:MetricExportAutoConfigurationTests.java   
@Test
public void exportMetricsEndpoint() {
    this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
            MetricEndpointConfiguration.class, MetricExportAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    MetricExporters exporters = this.context.getBean(MetricExporters.class);
    MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters()
            .get("writer");
    exporter.setIgnoreTimestamps(true);
    exporter.export();
    MetricsEndpointMetricReader reader = this.context.getBean("endpointReader",
            MetricsEndpointMetricReader.class);
    Mockito.verify(reader, Mockito.atLeastOnce()).findAll();
}
项目:contestparser    文件:MetricExportAutoConfigurationTests.java   
@Test
public void exportMetricsEndpoint() {
    this.context = new AnnotationConfigApplicationContext(WriterConfig.class,
            MetricEndpointConfiguration.class, MetricExportAutoConfiguration.class,
            PropertyPlaceholderAutoConfiguration.class);
    MetricExporters exporters = this.context.getBean(MetricExporters.class);
    MetricCopyExporter exporter = (MetricCopyExporter) exporters.getExporters()
            .get("writer");
    exporter.setIgnoreTimestamps(true);
    exporter.export();
    MetricsEndpointMetricReader reader = this.context.getBean("endpointReader",
            MetricsEndpointMetricReader.class);
    Mockito.verify(reader, Mockito.atLeastOnce()).findAll();
}
项目:statful-client-springboot    文件:SpringbootClientConfiguration.java   
/**
 * Enable a metrics reader.
 * @param metricsEndpoint {@link MetricsEndpoint}
 * @return {@link MetricsEndpointMetricReader}
 */
@Bean
@ConditionalOnProperty(value = "statful.client.springboot.metrics.enabled", havingValue = "true")
public MetricsEndpointMetricReader metricsEndpointMetricReader(final MetricsEndpoint metricsEndpoint) {
    return new MetricsEndpointMetricReader(metricsEndpoint);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricExportAutoConfigurationTests.java   
@Bean
@ExportMetricReader
public MetricsEndpointMetricReader endpointReader() {
    return Mockito.mock(MetricsEndpointMetricReader.class);
}
项目:spring-boot-concourse    文件:MetricExportAutoConfigurationTests.java   
@Bean
@ExportMetricReader
public MetricsEndpointMetricReader endpointReader() {
    return Mockito.mock(MetricsEndpointMetricReader.class);
}
项目:contestparser    文件:MetricExportAutoConfigurationTests.java   
@Bean
@ExportMetricReader
public MetricsEndpointMetricReader endpointReader() {
    return Mockito.mock(MetricsEndpointMetricReader.class);
}
项目:spring-cloud-stream    文件:ApplicationMetricsExporter.java   
public ApplicationMetricsExporter(MetricsEndpoint endpoint, MessageChannel source,
        ApplicationMetricsProperties properties) {
    this.source = source;
    this.properties = properties;
    this.metricsReader = new MetricsEndpointMetricReader(endpoint);
}