Class TextPrometheusMetricDataParser
- java.lang.Object
-
- org.hawkular.agent.prometheus.PrometheusMetricDataParser<MetricFamily>
-
- org.hawkular.agent.prometheus.text.TextPrometheusMetricDataParser
-
public class TextPrometheusMetricDataParser extends PrometheusMetricDataParser<MetricFamily>
Provides a method that can scrape Permetheus text metric data from input streams.
-
-
Constructor Summary
Constructors Constructor Description TextPrometheusMetricDataParser(InputStream inputStream)
Provides the input stream where the parser will look for metric data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricFamily
parse()
Reads a single metric family from the Prometheus metric data stream and returns it.-
Methods inherited from class org.hawkular.agent.prometheus.PrometheusMetricDataParser
getInputStream
-
-
-
-
Constructor Detail
-
TextPrometheusMetricDataParser
public TextPrometheusMetricDataParser(InputStream inputStream)
Provides the input stream where the parser will look for metric data. NOTE: this object will not own this stream - it should never attempt to close it.- Parameters:
inputStream
- the stream where the metric data can be found
-
-
Method Detail
-
parse
public MetricFamily parse() throws IOException
Description copied from class:PrometheusMetricDataParser
Reads a single metric family from the Prometheus metric data stream and returns it. Returns null when no more data is in the stream. This method is designed to be called several times, each time it returns the next metric family found in the input stream.- Specified by:
parse
in classPrometheusMetricDataParser<MetricFamily>
- Returns:
- the metric family data found in the stream, or null
- Throws:
IOException
- if failed to read the data from the stream
-
-