Java 类org.springframework.boot.actuate.metrics.reader.MetricReader 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricCopyExporter.java   
/**
 * Create a new {@link MetricCopyExporter} instance.
 * @param reader the metric reader
 * @param writer the metric writer
 * @param prefix the name prefix
 */
public MetricCopyExporter(MetricReader reader, GaugeWriter writer, String prefix) {
    super(prefix);
    this.reader = reader;
    this.writer = writer;
    if (writer instanceof CounterWriter) {
        this.counter = (CounterWriter) writer;
    }
    else {
        this.counter = null;
    }
}
项目: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    文件:PublicMetricsAutoConfiguration.java   
@Bean
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
    return new MetricReaderPublicMetrics(
            new CompositeMetricReader(this.metricReaders == null ? new MetricReader[0]
                    : this.metricReaders
                            .toArray(new MetricReader[this.metricReaders.size()])));
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void createServices() throws Exception {
    this.context = new AnnotationConfigApplicationContext(
            MetricRepositoryAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(BufferGaugeService.class);
    assertThat(gaugeService).isNotNull();
    assertThat(this.context.getBean(BufferCounterService.class)).isNotNull();
    assertThat(this.context.getBean(PrefixMetricReader.class)).isNotNull();
    gaugeService.submit("foo", 2.7);
    MetricReader bean = this.context.getBean(MetricReader.class);
    assertThat(bean.findOne("gauge.foo").getValue()).isEqualTo(2.7);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricReaderPublicMetricsTests.java   
@Test
public void exposesMetrics() {
    List<Metric<?>> metrics = new ArrayList<Metric<?>>();
    metrics.add(mock(Metric.class));
    metrics.add(mock(Metric.class));
    MetricReader reader = mock(MetricReader.class);
    given(reader.findAll()).willReturn(metrics);
    MetricReaderPublicMetrics publicMetrics = new MetricReaderPublicMetrics(reader);
    assertThat(publicMetrics.metrics()).isEqualTo(metrics);
}
项目:spring-boot-concourse    文件:MetricCopyExporter.java   
/**
 * Create a new {@link MetricCopyExporter} instance.
 * @param reader the metric reader
 * @param writer the metric writer
 * @param prefix the name prefix
 */
public MetricCopyExporter(MetricReader reader, GaugeWriter writer, String prefix) {
    super(prefix);
    this.reader = reader;
    this.writer = writer;
    if (writer instanceof CounterWriter) {
        this.counter = (CounterWriter) writer;
    }
    else {
        this.counter = null;
    }
}
项目: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    文件:PublicMetricsAutoConfiguration.java   
@Bean
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
    return new MetricReaderPublicMetrics(
            new CompositeMetricReader(this.metricReaders == null ? new MetricReader[0]
                    : this.metricReaders
                            .toArray(new MetricReader[this.metricReaders.size()])));
}
项目:spring-boot-concourse    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void createServices() throws Exception {
    this.context = new AnnotationConfigApplicationContext(
            MetricRepositoryAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(BufferGaugeService.class);
    assertThat(gaugeService).isNotNull();
    assertThat(this.context.getBean(BufferCounterService.class)).isNotNull();
    assertThat(this.context.getBean(PrefixMetricReader.class)).isNotNull();
    gaugeService.submit("foo", 2.7);
    MetricReader bean = this.context.getBean(MetricReader.class);
    assertThat(bean.findOne("gauge.foo").getValue()).isEqualTo(2.7);
}
项目:spring-boot-concourse    文件:MetricReaderPublicMetricsTests.java   
@Test
public void exposesMetrics() {
    List<Metric<?>> metrics = new ArrayList<Metric<?>>();
    metrics.add(mock(Metric.class));
    metrics.add(mock(Metric.class));
    MetricReader reader = mock(MetricReader.class);
    given(reader.findAll()).willReturn(metrics);
    MetricReaderPublicMetrics publicMetrics = new MetricReaderPublicMetrics(reader);
    assertThat(publicMetrics.metrics()).isEqualTo(metrics);
}
项目:contestparser    文件:MetricRepositoryAutoConfigurationTests.java   
@Test
public void createServices() throws Exception {
    this.context = new AnnotationConfigApplicationContext(
            MetricRepositoryAutoConfiguration.class);
    GaugeService gaugeService = this.context.getBean(BufferGaugeService.class);
    assertNotNull(gaugeService);
    assertNotNull(this.context.getBean(BufferCounterService.class));
    assertNotNull(this.context.getBean(PrefixMetricReader.class));
    gaugeService.submit("foo", 2.7);
    assertEquals(2.7,
            this.context.getBean(MetricReader.class).findOne("gauge.foo").getValue());
}
项目:contestparser    文件:MetricReaderPublicMetricsTests.java   
@Test
public void exposesMetrics() {
    List<Metric<?>> metrics = new ArrayList<Metric<?>>();
    metrics.add(mock(Metric.class));
    metrics.add(mock(Metric.class));
    MetricReader reader = mock(MetricReader.class);
    given(reader.findAll()).willReturn(metrics);
    MetricReaderPublicMetrics publicMetrics = new MetricReaderPublicMetrics(reader);
    assertEquals(metrics, publicMetrics.metrics());
}
项目:spring-boot-starter-batch-web    文件:MetricsListener.java   
public MetricsListener(GaugeService gaugeService, RichGaugeReader richGaugeReader,
        MetricReader metricReader, List<Exporter> exporters) {
    this.gaugeService = gaugeService;
    this.richGaugeReader = richGaugeReader;
    this.metricReader = metricReader;
    this.exporters = exporters;
}
项目:cat-boot    文件:ClusterMetricsConfig.java   
private MetricReader globalMetricsForAggregation() {
    return new RedisMetricRepository(this.redisConnectionFactory,
            this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey());
}
项目:cat-boot    文件:ClusterMetricsConfig.java   
private MetricReader aggregatesMetricReader() {
    AggregateMetricReader repository = new AggregateMetricReader(globalMetricsForAggregation());
    return repository;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AggregateMetricReader.java   
public AggregateMetricReader(MetricReader source) {
    this.source = source;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricCopyExporter.java   
PatternMatchingIterable(MetricReader reader) {
    this.reader = reader;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricExporters.java   
public void setReader(MetricReader reader) {
    this.reader = reader;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:PublicMetricsAutoConfiguration.java   
public PublicMetricsAutoConfiguration(
        @ExportMetricReader ObjectProvider<List<MetricReader>> metricReadersProvider) {
    this.metricReaders = metricReadersProvider.getIfAvailable();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricReaderPublicMetrics.java   
public MetricReaderPublicMetrics(MetricReader metricReader) {
    Assert.notNull(metricReader, "MetricReader must not be null");
    this.metricReader = metricReader;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AggregateMetricsConfiguration.java   
private MetricReader globalMetricsForAggregation() {
    return new RedisMetricRepository(this.connectionFactory,
            this.export.getRedis().getAggregatePrefix(),
            this.export.getRedis().getKey());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AggregateMetricsConfiguration.java   
private MetricReader aggregatesMetricReader() {
    AggregateMetricReader repository = new AggregateMetricReader(
            globalMetricsForAggregation());
    repository.setKeyPattern(this.export.getAggregate().getKeyPattern());
    return repository;
}
项目:HeliosStreams    文件:ActuatedMetricRegistryMetricReader.java   
/**
 * Exports a metric reader
 * @return a metric reader
 */
@Bean
@ExportMetricReader
public MetricReader metricReader() {
    return new MetricRegistryMetricReader(sharedRegistry);
}
项目:spring-boot-concourse    文件:AggregateMetricReader.java   
public AggregateMetricReader(MetricReader source) {
    this.source = source;
}
项目:spring-boot-concourse    文件:MetricCopyExporter.java   
PatternMatchingIterable(MetricReader reader) {
    this.reader = reader;
}
项目:spring-boot-concourse    文件:MetricExporters.java   
public void setReader(MetricReader reader) {
    this.reader = reader;
}
项目:spring-boot-concourse    文件:PublicMetricsAutoConfiguration.java   
public PublicMetricsAutoConfiguration(
        @ExportMetricReader ObjectProvider<List<MetricReader>> metricReadersProvider) {
    this.metricReaders = metricReadersProvider.getIfAvailable();
}
项目:spring-boot-concourse    文件:MetricReaderPublicMetrics.java   
public MetricReaderPublicMetrics(MetricReader metricReader) {
    Assert.notNull(metricReader, "MetricReader must not be null");
    this.metricReader = metricReader;
}
项目:spring-boot-concourse    文件:AggregateMetricsConfiguration.java   
private MetricReader globalMetricsForAggregation() {
    return new RedisMetricRepository(this.connectionFactory,
            this.export.getRedis().getAggregatePrefix(),
            this.export.getRedis().getKey());
}
项目:spring-boot-concourse    文件:AggregateMetricsConfiguration.java   
private MetricReader aggregatesMetricReader() {
    AggregateMetricReader repository = new AggregateMetricReader(
            globalMetricsForAggregation());
    repository.setKeyPattern(this.export.getAggregate().getKeyPattern());
    return repository;
}
项目:contestparser    文件:AggregateMetricReader.java   
public AggregateMetricReader(MetricReader source) {
    this.source = source;
}
项目:contestparser    文件:MetricCopyExporter.java   
PatternMatchingIterable(MetricReader reader) {
    this.reader = reader;
}
项目:contestparser    文件:MetricExporters.java   
public void setReader(MetricReader reader) {
    this.reader = reader;
}
项目:contestparser    文件:PublicMetricsAutoConfiguration.java   
@Bean
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
    return new MetricReaderPublicMetrics(new CompositeMetricReader(
            this.metricReaders.toArray(new MetricReader[0])));
}
项目:contestparser    文件:MetricReaderPublicMetrics.java   
public MetricReaderPublicMetrics(MetricReader metricReader) {
    Assert.notNull(metricReader, "MetricReader must not be null");
    this.metricReader = metricReader;
}
项目:contestparser    文件:AggregateMetricsConfiguration.java   
private MetricReader globalMetricsForAggregation() {
    return new RedisMetricRepository(this.connectionFactory,
            this.export.getRedis().getAggregatePrefix(),
            this.export.getRedis().getKey());
}
项目:contestparser    文件:AggregateMetricsConfiguration.java   
private MetricReader aggregatesMetricReader() {
    AggregateMetricReader repository = new AggregateMetricReader(
            globalMetricsForAggregation());
    repository.setKeyPattern(this.export.getAggregate().getKeyPattern());
    return repository;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:MetricCopyExporter.java   
/**
 * Create a new {@link MetricCopyExporter} instance.
 * @param reader the metric reader
 * @param writer the metric writer
 */
public MetricCopyExporter(MetricReader reader, GaugeWriter writer) {
    this(reader, writer, "");
}
项目:spring-boot-concourse    文件:MetricCopyExporter.java   
/**
 * Create a new {@link MetricCopyExporter} instance.
 * @param reader the metric reader
 * @param writer the metric writer
 */
public MetricCopyExporter(MetricReader reader, GaugeWriter writer) {
    this(reader, writer, "");
}
项目:contestparser    文件:MetricCopyExporter.java   
/**
 * Create a new {@link MetricCopyExporter} instance.
 * @param reader the metric reader
 * @param writer the metric writer
 */
public MetricCopyExporter(MetricReader reader, MetricWriter writer) {
    this(reader, writer, "");
}