Interface Metric<T>

All Known Subinterfaces:
NodeMetric<T>, ReplicaMetric<T>
All Known Implementing Classes:
MetricImpl, NodeMetricImpl, ReplicaMetricImpl

public interface Metric<T>
Metric-related attribute of a node or replica. It defines a short symbolic name of the metric, the corresponding internal metric name and the desired format/unit conversion. Generic type specifies the type of converted values of this attribute.
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(Object value)
    Convert raw value.
    Return the internal name of a Solr metric associated with this attribute.
    default String
    Return the label key for Prometheus metrics filtering, if any.
    default String
    Return the label value for Prometheus metrics filtering, if any.
    Return the short-hand name that identifies this attribute.
    default boolean
    Return true if this metric has label filtering.
  • Method Details

    • getName

      String getName()
      Return the short-hand name that identifies this attribute.
    • getInternalName

      String getInternalName()
      Return the internal name of a Solr metric associated with this attribute.
    • convert

      T convert(Object value)
      Convert raw value. This may involve changing raw value type or units.
      Parameters:
      value - raw value
      Returns:
      converted value
    • getLabelKey

      default String getLabelKey()
      Return the label key for Prometheus metrics filtering, if any.
      Returns:
      label key or null if no label filtering is needed
    • getLabelValue

      default String getLabelValue()
      Return the label value for Prometheus metrics filtering, if any.
      Returns:
      label value or null if no label filtering is needed
    • hasLabels

      default boolean hasLabels()
      Return true if this metric has label filtering.
      Returns:
      true if both label key and value are non-null