当前位置: 首页>>代码示例>>Java>>正文


Java GaugeWriter类代码示例

本文整理汇总了Java中org.springframework.boot.actuate.metrics.writer.GaugeWriter的典型用法代码示例。如果您正苦于以下问题:Java GaugeWriter类的具体用法?Java GaugeWriter怎么用?Java GaugeWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GaugeWriter类属于org.springframework.boot.actuate.metrics.writer包,在下文中一共展示了GaugeWriter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: flush

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的package包/类
private void flush(GaugeWriter writer) {
	if (writer instanceof CompositeMetricWriter) {
		for (MetricWriter child : (CompositeMetricWriter) writer) {
			flush(child);
		}
	}
	try {
		if (ClassUtils.isPresent("java.io.Flushable", null)) {
			if (writer instanceof Flushable) {
				((Flushable) writer).flush();
				return;
			}
		}
		Method method = ReflectionUtils.findMethod(writer.getClass(), "flush");
		if (method != null) {
			ReflectionUtils.invokeMethod(method, writer);
		}
	}
	catch (Exception ex) {
		logger.warn("Could not flush MetricWriter: " + ex.getClass() + ": "
				+ ex.getMessage());
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:24,代码来源:MetricCopyExporter.java

示例2: openTsdbMetricWriter

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的package包/类
@Bean
@ConfigurationProperties("metrics.export")
@ExportMetricWriter
public GaugeWriter openTsdbMetricWriter() {
	OpenTsdbGaugeWriter writer = new OpenTsdbGaugeWriter();
	writer.setNamingStrategy(namingStrategy());
	return writer;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:SampleOpenTsdbExportApplication.java

示例3: MetricCopyExporter

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的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

示例4: getExporter

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的package包/类
private MetricCopyExporter getExporter(GaugeWriter writer,
		TriggerProperties trigger) {
	MetricCopyExporter exporter = new MetricCopyExporter(this.reader, writer);
	exporter.setIncludes(trigger.getIncludes());
	exporter.setExcludes(trigger.getExcludes());
	exporter.setSendLatest(trigger.isSendLatest());
	return exporter;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:MetricExporters.java

示例5: MetricExportAutoConfiguration

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的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

示例6: setWriters

import org.springframework.boot.actuate.metrics.writer.GaugeWriter; //导入依赖的package包/类
public void setWriters(Map<String, GaugeWriter> writers) {
	this.writers.putAll(writers);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:4,代码来源:MetricExporters.java


注:本文中的org.springframework.boot.actuate.metrics.writer.GaugeWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。