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 TypeMethodDescriptionConvert raw value.Return the internal name of a Solr metric associated with this attribute.default StringReturn the label key for Prometheus metrics filtering, if any.default StringReturn the label value for Prometheus metrics filtering, if any.getName()Return the short-hand name that identifies this attribute.default booleanReturn 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
Convert raw value. This may involve changing raw value type or units.- Parameters:
value- raw value- Returns:
- converted value
-
getLabelKey
Return the label key for Prometheus metrics filtering, if any.- Returns:
- label key or null if no label filtering is needed
-
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
-