public class PrometheusMetricsSink extends Object implements MetricsSink
Stores the metric data in-memory and return with it on request.
Constructor and Description |
---|
PrometheusMetricsSink() |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flush any buffered metrics
|
void |
init(org.apache.commons.configuration2.SubsetConfiguration subsetConfiguration)
Initialize the plugin
|
String |
prometheusName(String recordName,
String metricName)
Convert CamelCase based names to lower-case names where the separator
is the underscore, to follow prometheus naming conventions.
|
void |
putMetrics(MetricsRecord metricsRecord)
Put a metrics record in the sink
|
void |
writeMetrics(Writer writer) |
public void putMetrics(MetricsRecord metricsRecord)
MetricsSink
putMetrics
in interface MetricsSink
metricsRecord
- the record to putpublic String prometheusName(String recordName, String metricName)
public void flush()
MetricsSink
flush
in interface MetricsSink
public void init(org.apache.commons.configuration2.SubsetConfiguration subsetConfiguration)
MetricsPlugin
init
in interface MetricsPlugin
subsetConfiguration
- the configuration object for the pluginpublic void writeMetrics(Writer writer) throws IOException
IOException
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.