本文整理汇总了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();
}
}
}
}
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:27,代码来源:MetricsListener.java
示例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;
}
开发者ID:codecentric,项目名称:spring-boot-starter-batch-web,代码行数:8,代码来源:MetricsListener.java
示例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());
}
开发者ID:netflix-spring-one,项目名称:spring-cloud-netflix-contrib,代码行数:6,代码来源:AtlasAutoConfiguration.java
示例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
注:本文中的org.springframework.boot.actuate.metrics.export.Exporter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论