Enum Class NodeValueFetcher.Metrics
- All Implemented Interfaces:
Serializable,Comparable<NodeValueFetcher.Metrics>,java.lang.constant.Constable
- Enclosing class:
NodeValueFetcher
Various well known tags that can be fetched from a node
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionextractFromPrometheus(List<String> prometheusLines) Extract metric value from Prometheus response lines, optionally filtering by label.static DoubleextractPrometheusValue(String line) Extracts the numeric value from a Prometheus metric line.prometheusMetricStream(InputStream inputStream) Returns a Stream of Prometheus lines for processing with filtered out comment linesstatic NodeValueFetcher.MetricsReturns the enum constant of this class with the specified name.static NodeValueFetcher.Metrics[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FREEDISK
-
TOTALDISK
-
CORES
-
SYSLOADAVG
-
-
Field Details
-
tagName
-
metricName
-
labelKey
-
labelValue
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
extractFromPrometheus
Extract metric value from Prometheus response lines, optionally filtering by label. This consolidated method handles both labeled and unlabeled metrics. This method assumes 1 metric, so will get the first metricName it sees with associated label and value. -
extractPrometheusValue
Extracts the numeric value from a Prometheus metric line. Sample inputs: - With labels: solr_metrics_core_requests_total{core="demo",...} 123.0 - Without labels: solr_metrics_core_requests_total 123.0 - With exemplars: solr_metrics_core_requests_total{core="demo"} 123.0 # {trace_id="abc123"} 2.0 1234567890 -
prometheusMetricStream
Returns a Stream of Prometheus lines for processing with filtered out comment lines
-