當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。