Class MetricDescriptor

  • Direct Known Subclasses:
    AutoValue_MetricDescriptor

    @Immutable
    public abstract class MetricDescriptor
    extends java.lang.Object
    Describes a metric that will be output.

    Provides equality/identity semantics for detecting duplicate metrics of incompatible.

    This class is internal and is hence not for public use. Its APIs are unstable and can change at any time.

    • Field Detail

      • viewSourceInfo

        private final java.util.concurrent.atomic.AtomicReference<SourceInfo> viewSourceInfo
      • hashcode

        private int hashcode
    • Constructor Detail

      • MetricDescriptor

        MetricDescriptor()
    • Method Detail

      • create

        public static MetricDescriptor create​(java.lang.String name,
                                              java.lang.String description,
                                              java.lang.String unit)
        Constructs a metric descriptor with no instrument and default view.

        Used for testing + empty-storage only.

      • getView

        public abstract View getView()
        The view that lead to the creation of this metric.
      • getSourceInstrument

        public abstract InstrumentDescriptor getSourceInstrument()
        The instrument which lead to the creation of this metric.
      • hashCode

        public final int hashCode()
        Uses case-insensitive version of getName().
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object o)
        Uses case-insensitive version of getName().
        Overrides:
        equals in class java.lang.Object