Class MetricDescriptor
java.lang.Object
io.opentelemetry.sdk.metrics.internal.descriptor.MetricDescriptor
- Direct Known Subclasses:
AutoValue_MetricDescriptor
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MetricDescriptor
create
(View view, SourceInfo viewSourceInfo, InstrumentDescriptor instrument) Constructs a metric descriptor for a given View + instrument.static MetricDescriptor
Constructs a metric descriptor with no instrument and default view.final boolean
Uses case-insensitive version ofgetName()
.TheAggregationUtil.aggregationName(Aggregation)
of the view aggregation.abstract String
The description of the descriptor, equal toView.getDescription()
if not null, elseInstrumentDescriptor.getDescription()
.abstract String
getName()
The name of the descriptor, equal toView.getName()
if not null, elseInstrumentDescriptor.getName()
.abstract InstrumentDescriptor
The instrument which lead to the creation of this metric.abstract View
getView()
The view that lead to the creation of this metric.final SourceInfo
TheSourceInfo
from where the view was registered.final int
hashCode()
Uses case-insensitive version ofgetName()
.
-
Field Details
-
viewSourceInfo
-
hashcode
private int hashcode
-
-
Constructor Details
-
MetricDescriptor
MetricDescriptor()
-
-
Method Details
-
create
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
The name of the descriptor, equal toView.getName()
if not null, elseInstrumentDescriptor.getName()
. -
getDescription
The description of the descriptor, equal toView.getDescription()
if not null, elseInstrumentDescriptor.getDescription()
. -
getView
The view that lead to the creation of this metric. -
getViewSourceInfo
TheSourceInfo
from where the view was registered. Ignored fromequals(Object)
andObject.toString()
. -
getSourceInstrument
The instrument which lead to the creation of this metric. -
getAggregationName
TheAggregationUtil.aggregationName(Aggregation)
of the view aggregation. -
hashCode
public final int hashCode()Uses case-insensitive version ofgetName()
. -
equals
Uses case-insensitive version ofgetName()
.
-