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 MetricDescriptorcreate(View view, SourceInfo viewSourceInfo, InstrumentDescriptor instrument) Constructs a metric descriptor for a given View + instrument.static MetricDescriptorConstructs a metric descriptor with no instrument and default view.final booleanUses case-insensitive version ofgetName().TheAggregationUtil.aggregationName(Aggregation)of the view aggregation.abstract StringThe description of the descriptor, equal toView.getDescription()if not null, elseInstrumentDescriptor.getDescription().abstract StringgetName()The name of the descriptor, equal toView.getName()if not null, elseInstrumentDescriptor.getName().abstract InstrumentDescriptorThe instrument which lead to the creation of this metric.abstract ViewgetView()The view that lead to the creation of this metric.final SourceInfoTheSourceInfofrom where the view was registered.final inthashCode()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
TheSourceInfofrom 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().
-