Interface InternalBridge.Metadata

  • Enclosing interface:
    InternalBridge

    public static interface InternalBridge.Metadata
    Version-neutral abstraction of metric metadata.

    Although this interface supports tags, if you are using MicroProfile Metrics 2.0 or later the system ignores tags associated with metadata.

    • Method Detail

      • getName

        String getName()
        Returns:
        the metric name stored in the metadata
      • getDisplayName

        String getDisplayName()
        Returns:
        the display name
      • getDescription

        Optional<String> getDescription()
        Returns:
        an Optional of the metadata description
      • getType

        String getType()
        Returns:
        the metric type as a String
      • getTypeRaw

        MetricType getTypeRaw()
        Returns:
        the metric type as a MicroProfile Metrics {link MetricType}
      • getUnit

        Optional<String> getUnit()
        Returns:
        an Optional of the unit associated with this metadata
      • isReusable

        boolean isReusable()
        Returns:
        whether metrics described by this metadata are reusable or not
      • getTags

        Map<String,​String> getTags()
        Returns the tags associated with the metadata.

        Note that if you are using MicroProfile Metrics 2.0 and later the tags associated with this version-neutral metadata are ignored.

        Returns:
        tags
      • newMetadata

        static InternalBridge.Metadata newMetadata​(String name,
                                                   String displayName,
                                                   String description,
                                                   MetricType type,
                                                   String unit,
                                                   boolean isReusable,
                                                   Map<String,​String> tags)
        Prepares a version-neutral InternalBridge.Metadata instance using the specified values, avoiding the need to create and act on a builder.

        Note that although this method accepts tags, if you are using MicroProfile Metrics 2.0 or later the returned metadata will not include the tags.

        Parameters:
        name - name for the metrics associated with the metadata
        displayName - display name
        description - description of the metric
        type - MetricType of the metric
        unit - unit that applies to the metric
        isReusable - whether or not metrics based on this metadata should be reusable
        tags - name/value pairs representing tags
        Returns:
        the prepared version-neutral Metadata
      • newMetadata

        static InternalBridge.Metadata newMetadata​(String name,
                                                   String displayName,
                                                   String description,
                                                   MetricType type,
                                                   String unit,
                                                   Map<String,​String> tags)
        Prepares a version-neutral InternalBridge.Metadata instance using the specified values, avoiding the need to create and act on a builder.

        Note that although this method accepts tags, if you are using MicroProfile Metrics 2.0 or later the returned metadata will not include the tags.

        Also note that whether the metadata is reusable relies on the underlying MicroProfile Metrics version you are using.

        Parameters:
        name - name for the metrics associated with the metadata
        displayName - display name
        description - description of the metric
        type - MetricType of the metric
        unit - unit that applies to the metric
        tags - name/value pairs representing tags
        Returns:
        the prepared version-neutral Metadata
      • newMetadata

        static InternalBridge.Metadata newMetadata​(String name,
                                                   String displayName,
                                                   String description,
                                                   MetricType type,
                                                   String unit)
        Prepares a version-neutral InternalBridge.Metadata instance using the specified values, avoiding the need to create and act on a builder.

        Note that whether the metadata is reusable relies on the underlying MicroProfile Metrics version you are using.

        Parameters:
        name - name for the metrics associated with the metadata
        displayName - display name
        description - description of the metric
        type - MetricType of the metric
        unit - unit that applies to the metric
        Returns:
        the prepared version-neutral Metadata