Interface Registry

All Superinterfaces:
MetricRegistry
All Known Implementing Classes:
AbstractRegistry

public interface Registry extends MetricRegistry
Helidon Metric registry.
  • Method Details

    • enabled

      boolean enabled(String metricName)
      Whether a metric is enabled. Metrics can be disabled by name (disables all IDs associated with that name).
      Parameters:
      metricName - name to look for
      Returns:
      whether the metric is enabled
    • stream

      Steam all metrics from this registry.
      Returns:
      stream of metric instances and their IDs
    • find

      Optional<MetricInstance> find(String metricName)
      Returns an Optional for an entry containing a metric ID and the corresponding metric matching the specified metric name.

      If multiple metrics match the name (because of tags), the returned metric is, preferentially, the one (if any) with no tags. If all metrics registered under the specified name have tags, then the method returns the metric which was registered earliest

      Parameters:
      metricName - name of the metric of interest
      Returns:
      Optional of a map entry containing the metric ID and the metric selected
    • list

      List<MetricInstance> list(String metricName)
      Returns a list of metric ID/metric pairs which match the provided metric name.
      Parameters:
      metricName - name of the metric of interest
      Returns:
      List of entries indicating metrics with the specified name; empty of no matches
    • empty

      boolean empty()
      Whether this registry is empty, or contains any metrics.
      Returns:
      true if this registry is empty
    • type

      String type()
      Registry type.
      Returns:
      type
    • metricIdsByName

      List<MetricID> metricIdsByName(String name)
      Get all metric IDs for a specified name.
      Parameters:
      name - name to look for
      Returns:
      metric IDs for the name (may have more than one, as tags may be used)
    • metricsByName

      Optional<MetricsForMetadata> metricsByName(String name)
      Get all metrics by a specified name.
      Parameters:
      name - name to look for
      Returns:
      all metrics (and associated metadata) if exist
    • getMetric

      HelidonMetric getMetric(MetricID metricID)
      Metric instance for a metric ID.
      Specified by:
      getMetric in interface MetricRegistry
      Parameters:
      metricID - lookup key, not null
      Returns:
      metric instance