本文整理汇总了Java中org.springframework.boot.actuate.metrics.reader.MetricReader类的典型用法代码示例。如果您正苦于以下问题:Java MetricReader类的具体用法?Java MetricReader怎么用?Java MetricReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MetricReader类属于org.springframework.boot.actuate.metrics.reader包,在下文中一共展示了MetricReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: MetricCopyExporter
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
/**
* 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;
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:18,代码来源:MetricCopyExporter.java
示例2: MetricExportAutoConfiguration
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
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();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:MetricExportAutoConfiguration.java
示例3: metricReaderPublicMetrics
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@Bean
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
return new MetricReaderPublicMetrics(
new CompositeMetricReader(this.metricReaders == null ? new MetricReader[0]
: this.metricReaders
.toArray(new MetricReader[this.metricReaders.size()])));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:PublicMetricsAutoConfiguration.java
示例4: createServices
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:MetricRepositoryAutoConfigurationTests.java
示例5: exposesMetrics
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:MetricReaderPublicMetricsTests.java
示例6: createServices
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@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());
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:13,代码来源:MetricRepositoryAutoConfigurationTests.java
示例7: exposesMetrics
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@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());
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:MetricReaderPublicMetricsTests.java
示例8: MetricsListener
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
public MetricsListener(GaugeService gaugeService, RichGaugeReader richGaugeReader,
MetricReader metricReader, List<Exporter> exporters) {
this.gaugeService = gaugeService;
this.richGaugeReader = richGaugeReader;
this.metricReader = metricReader;
this.exporters = exporters;
}
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:8,代码来源:MetricsListener.java
示例9: globalMetricsForAggregation
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
private MetricReader globalMetricsForAggregation() {
return new RedisMetricRepository(this.redisConnectionFactory,
this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey());
}
开发者ID:Catalysts,项目名称:cat-boot,代码行数:5,代码来源:ClusterMetricsConfig.java
示例10: aggregatesMetricReader
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
private MetricReader aggregatesMetricReader() {
AggregateMetricReader repository = new AggregateMetricReader(globalMetricsForAggregation());
return repository;
}
开发者ID:Catalysts,项目名称:cat-boot,代码行数:5,代码来源:ClusterMetricsConfig.java
示例11: AggregateMetricReader
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
public AggregateMetricReader(MetricReader source) {
this.source = source;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:AggregateMetricReader.java
示例12: PatternMatchingIterable
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
PatternMatchingIterable(MetricReader reader) {
this.reader = reader;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:MetricCopyExporter.java
示例13: setReader
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
public void setReader(MetricReader reader) {
this.reader = reader;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:MetricExporters.java
示例14: PublicMetricsAutoConfiguration
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
public PublicMetricsAutoConfiguration(
@ExportMetricReader ObjectProvider<List<MetricReader>> metricReadersProvider) {
this.metricReaders = metricReadersProvider.getIfAvailable();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:PublicMetricsAutoConfiguration.java
示例15: MetricReaderPublicMetrics
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
public MetricReaderPublicMetrics(MetricReader metricReader) {
Assert.notNull(metricReader, "MetricReader must not be null");
this.metricReader = metricReader;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:MetricReaderPublicMetrics.java
示例16: globalMetricsForAggregation
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
private MetricReader globalMetricsForAggregation() {
return new RedisMetricRepository(this.connectionFactory,
this.export.getRedis().getAggregatePrefix(),
this.export.getRedis().getKey());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:AggregateMetricsConfiguration.java
示例17: aggregatesMetricReader
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
private MetricReader aggregatesMetricReader() {
AggregateMetricReader repository = new AggregateMetricReader(
globalMetricsForAggregation());
repository.setKeyPattern(this.export.getAggregate().getKeyPattern());
return repository;
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:AggregateMetricsConfiguration.java
示例18: metricReader
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
/**
* Exports a metric reader
* @return a metric reader
*/
@Bean
@ExportMetricReader
public MetricReader metricReader() {
return new MetricRegistryMetricReader(sharedRegistry);
}
开发者ID:nickman,项目名称:HeliosStreams,代码行数:10,代码来源:ActuatedMetricRegistryMetricReader.java
示例19: metricReaderPublicMetrics
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
@Bean
public MetricReaderPublicMetrics metricReaderPublicMetrics() {
return new MetricReaderPublicMetrics(new CompositeMetricReader(
this.metricReaders.toArray(new MetricReader[0])));
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:6,代码来源:PublicMetricsAutoConfiguration.java
示例20: MetricCopyExporter
import org.springframework.boot.actuate.metrics.reader.MetricReader; //导入依赖的package包/类
/**
* 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, "");
}
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:MetricCopyExporter.java
注:本文中的org.springframework.boot.actuate.metrics.reader.MetricReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论