Class MetricDescriptor
- java.lang.Object
-
- io.opentelemetry.sdk.metrics.internal.descriptor.MetricDescriptor
-
- Direct Known Subclasses:
AutoValue_MetricDescriptor
@Immutable public abstract class MetricDescriptor extends java.lang.ObjectDescribes 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 Summary
Fields Modifier and Type Field Description private inthashcodeprivate java.util.concurrent.atomic.AtomicReference<SourceInfo>viewSourceInfo
-
Constructor Summary
Constructors Constructor Description MetricDescriptor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MetricDescriptorcreate(View view, SourceInfo viewSourceInfo, InstrumentDescriptor instrument)Constructs a metric descriptor for a given View + instrument.static MetricDescriptorcreate(java.lang.String name, java.lang.String description, java.lang.String unit)Constructs a metric descriptor with no instrument and default view.booleanequals(java.lang.Object o)Uses case-insensitive version ofgetName().java.lang.StringgetAggregationName()TheAggregationUtil.aggregationName(Aggregation)of the view aggregation.abstract java.lang.StringgetDescription()The description of the descriptor, equal toView.getDescription()if not null, elseInstrumentDescriptor.getDescription().abstract java.lang.StringgetName()The name of the descriptor, equal toView.getName()if not null, elseInstrumentDescriptor.getName().abstract InstrumentDescriptorgetSourceInstrument()The instrument which lead to the creation of this metric.abstract ViewgetView()The view that lead to the creation of this metric.SourceInfogetViewSourceInfo()TheSourceInfofrom where the view was registered.inthashCode()Uses case-insensitive version ofgetName().
-
-
-
Field Detail
-
viewSourceInfo
private final java.util.concurrent.atomic.AtomicReference<SourceInfo> viewSourceInfo
-
hashcode
private int hashcode
-
-
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.
-
create
public static MetricDescriptor create(View view, SourceInfo viewSourceInfo, InstrumentDescriptor instrument)
Constructs a metric descriptor for a given View + instrument.
-
getName
public abstract java.lang.String getName()
The name of the descriptor, equal toView.getName()if not null, elseInstrumentDescriptor.getName().
-
getDescription
public abstract java.lang.String getDescription()
The description of the descriptor, equal toView.getDescription()if not null, elseInstrumentDescriptor.getDescription().
-
getView
public abstract View getView()
The view that lead to the creation of this metric.
-
getViewSourceInfo
public final SourceInfo getViewSourceInfo()
TheSourceInfofrom where the view was registered. Ignored fromequals(Object)andObject.toString().
-
getSourceInstrument
public abstract InstrumentDescriptor getSourceInstrument()
The instrument which lead to the creation of this metric.
-
getAggregationName
public java.lang.String getAggregationName()
TheAggregationUtil.aggregationName(Aggregation)of the view aggregation.
-
hashCode
public final int hashCode()
Uses case-insensitive version ofgetName().- Overrides:
hashCodein classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
Uses case-insensitive version ofgetName().- Overrides:
equalsin classjava.lang.Object
-
-