Enum Class NodeValueFetcher.Metrics

java.lang.Object
java.lang.Enum<NodeValueFetcher.Metrics>
org.apache.solr.client.solrj.impl.NodeValueFetcher.Metrics
All Implemented Interfaces:
Serializable, Comparable<NodeValueFetcher.Metrics>, java.lang.constant.Constable
Enclosing class:
NodeValueFetcher

public static enum NodeValueFetcher.Metrics extends Enum<NodeValueFetcher.Metrics>
Various well known tags that can be fetched from a node
  • Enum Constant Details

  • Field Details

    • tagName

      public final String tagName
    • metricName

      public final String metricName
    • labelKey

      public final String labelKey
    • labelValue

      public final String labelValue
  • Method Details

    • values

      public static NodeValueFetcher.Metrics[] 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

      public static NodeValueFetcher.Metrics valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • extractFromPrometheus

      public Object extractFromPrometheus(List<String> prometheusLines)
      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

      public static Double extractPrometheusValue(String line)
      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

      public static Stream<String> prometheusMetricStream(InputStream inputStream)
      Returns a Stream of Prometheus lines for processing with filtered out comment lines