本文整理汇总了Java中org.springframework.boot.actuate.metrics.export.Exporter类的典型用法代码示例。如果您正苦于以下问题:Java Exporter类的具体用法?Java Exporter怎么用?Java Exporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Exporter类属于org.springframework.boot.actuate.metrics.export包,在下文中一共展示了Exporter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: afterJob
import org.springframework.boot.actuate.metrics.export.Exporter; //导入依赖的package包/类
@Override
public void afterJob(JobExecution jobExecution) {
long jobDuration = jobExecution.getEndTime().getTime() - jobExecution.getStartTime().getTime();
gaugeService.submit(TIMER_PREFIX + jobExecution.getJobInstance().getJobName() + ".duration", jobDuration);
// What the f*** is that Thread.sleep doing here? ;-)
// Metrics are written asynchronously to Spring Boot's repository. In our tests we experienced
// that sometimes batch execution was so fast that this listener couldn't export the metrics
// because they hadn't been written. It all happened in the same millisecond. So we added
// a Thread.sleep of 100 milliseconds which gives us enough safety and doesn't hurt anyone.
try {
Thread.sleep(100);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
// Export Metrics to Console or Remote Systems
LOGGER.info(metricsOutputFormatter.format(exportBatchRichGauges(), exportBatchMetrics()));
// Codahale
if (exporters != null) {
for (Exporter exporter : exporters) {
if (exporter != null) {
LOGGER.info("Exporting Metrics with " + exporter.getClass().getName());
exporter.export();
}
}
}
}
示例2: MetricExportAutoConfiguration
import org.springframework.boot.actuate.metrics.export.Exporter; //导入依赖的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: MetricsListener
import org.springframework.boot.actuate.metrics.export.Exporter; //导入依赖的package包/类
public MetricsListener(GaugeService gaugeService, RichGaugeReader richGaugeReader,
MetricReader metricReader, List<Exporter> exporters) {
this.gaugeService = gaugeService;
this.richGaugeReader = richGaugeReader;
this.metricReader = metricReader;
this.exporters = exporters;
}
示例4: exporter
import org.springframework.boot.actuate.metrics.export.Exporter; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean(Exporter.class)
public AtlasExporter exporter(AtlasMetricObserver observer, MetricPoller poller, AtlasProperties properties) {
return new AtlasExporter(observer, poller, properties.getPublishDelay());
}
示例5: exporter
import org.springframework.boot.actuate.metrics.export.Exporter; //导入依赖的package包/类
@Bean
Exporter exporter() {
return Mockito.mock(Exporter.class);
}
开发者ID:netflix-spring-one,项目名称:spring-cloud-netflix-contrib,代码行数:5,代码来源:AtlasAutoConfigurationIntegrationTests.java