Interface OciMetricsSupport.NameFormatter

Enclosing class:
OciMetricsSupport

public static interface OciMetricsSupport.NameFormatter
Prescribes behavior for formatting metric names for use by OCI.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    format(Meter metric, Meter.Id metricId, String suffix, String unit)
    Formats a metric name for OCI.
    static String
    textType(Meter metric)
    Converts a metric instance into the corresponding text representation of its metric type.
  • Method Details

    • format

      default String format(Meter metric, Meter.Id metricId, String suffix, String unit)
      Formats a metric name for OCI.

      The default implementation creates an OCI metric name with this format: metric-name[_suffix][_units] where _suffix is omitted if the caller passes a null suffix, and _units is omitted if the metrics metadata does not have units set or, in translating the units for OCI, the result is blank.

      Parameters:
      metric - the metric to be formatted
      metricId - MetricID of the metric being formatted
      suffix - name suffix to append to the recorded metric name (e.g, "total"); can be null
      unit - metric unit
      Returns:
      the formatted metric name
    • textType

      static String textType(Meter metric)
      Converts a metric instance into the corresponding text representation of its metric type.
      Parameters:
      metric - Meter to be converted
      Returns:
      text type of the metric