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.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 Summary
Fields Modifier and Type Field Description private int
hashcode
private 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 MetricDescriptor
create(View view, SourceInfo viewSourceInfo, InstrumentDescriptor instrument)
Constructs a metric descriptor for a given View + instrument.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.boolean
equals(java.lang.Object o)
Uses case-insensitive version ofgetName()
.java.lang.String
getAggregationName()
TheAggregationUtil.aggregationName(Aggregation)
of the view aggregation.abstract java.lang.String
getDescription()
The description of the descriptor, equal toView.getDescription()
if not null, elseInstrumentDescriptor.getDescription()
.abstract java.lang.String
getName()
The name of the descriptor, equal toView.getName()
if not null, elseInstrumentDescriptor.getName()
.abstract InstrumentDescriptor
getSourceInstrument()
The instrument which lead to the creation of this metric.abstract View
getView()
The view that lead to the creation of this metric.SourceInfo
getViewSourceInfo()
TheSourceInfo
from where the view was registered.int
hashCode()
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()
TheSourceInfo
from 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:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object o)
Uses case-insensitive version ofgetName()
.- Overrides:
equals
in classjava.lang.Object
-
-