Package org.hawkular.agent.prometheus
Class PrometheusMetricsProcessor<T>
- java.lang.Object
-
- org.hawkular.agent.prometheus.PrometheusMetricsProcessor<T>
-
- Direct Known Subclasses:
TextPrometheusMetricsProcessor
public abstract class PrometheusMetricsProcessor<T> extends java.lang.Object
A processor is responsible for iterating over a collection of metric families found in a specific data format and invoking a walker during the iteration so the metric families can be processed.
-
-
Constructor Summary
Constructors Constructor Description PrometheusMetricsProcessor(java.io.InputStream inputStream, PrometheusMetricsWalker theWalker)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract MetricFamily
convert(T metricFamily)
This method converts the metrics from the specific data format found in the input stream to the common metric format.protected abstract PrometheusMetricDataParser<T>
createPrometheusMetricDataParser()
protected java.io.InputStream
getInputStream()
protected PrometheusMetricsWalker
getWalker()
void
walk()
-
-
-
Constructor Detail
-
PrometheusMetricsProcessor
public PrometheusMetricsProcessor(java.io.InputStream inputStream, PrometheusMetricsWalker theWalker)
- Parameters:
inputStream
- where the Prometheus metrics are that the walker will traverse.theWalker
- the actual object that will be notified about the metrics as they are encountered
-
-
Method Detail
-
walk
public void walk()
-
getInputStream
protected java.io.InputStream getInputStream()
- Returns:
- the input stream where the metric family data in a specific data format is found
-
getWalker
protected PrometheusMetricsWalker getWalker()
- Returns:
- the object that will iterate over the found metric data
-
createPrometheusMetricDataParser
protected abstract PrometheusMetricDataParser<T> createPrometheusMetricDataParser()
- Returns:
- a new parser instance that can be used to parse the formatted data
found in the
input stream
.
-
convert
protected abstract MetricFamily convert(T metricFamily)
This method converts the metrics from the specific data format found in the input stream to the common metric format.- Parameters:
metricFamily
- the metric family (and its metrics) that need to be converted- Returns:
- the common MetricFamily object
-
-