Class EmptyMetricData
java.lang.Object
io.opentelemetry.sdk.metrics.internal.aggregator.EmptyMetricData
- All Implemented Interfaces:
MetricData
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 TypeMethodDescriptionData
<?> getData()
Returns the unconstrained metric data.Returns the metric description.static MetricData
Get an empty instance of metric data.Returns the metricInstrumentationScopeInfo
.getName()
Returns the metric name.Returns the metricResource
.getType()
Returns the type of this metric.getUnit()
Returns the metric unit.boolean
isEmpty()
Returnstrue
if there are no points associated with this metric.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.opentelemetry.sdk.metrics.data.MetricData
getDoubleGaugeData, getDoubleSumData, getExponentialHistogramData, getHistogramData, getLongGaugeData, getLongSumData, getSummaryData
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyMetricData
private EmptyMetricData()
-
-
Method Details
-
getInstance
Get an empty instance of metric data. Empty metric data should not be used except as an indication that recordings were dropped viaAggregation.drop()
.- Returns:
- an empty MetricData.
-
getResource
Description copied from interface:MetricData
Returns the metricResource
.The
Resource
is configured viaSdkMeterProviderBuilder.setResource(Resource)
.- Specified by:
getResource
in interfaceMetricData
-
getInstrumentationScopeInfo
Description copied from interface:MetricData
Returns the metricInstrumentationScopeInfo
.The
InstrumentationScopeInfo
is determined from the options used whenMeterBuilder.build()
ing theMeter
.- Specified by:
getInstrumentationScopeInfo
in interfaceMetricData
-
getName
Description copied from interface:MetricData
Returns the metric name.The metric name is typically the instrument name, but may be optionally overridden by a
View
.- Specified by:
getName
in interfaceMetricData
-
getDescription
Description copied from interface:MetricData
Returns the metric description.The metric name is typically the instrument description, but may be optionally overridden by a
View
.- Specified by:
getDescription
in interfaceMetricData
-
getUnit
Description copied from interface:MetricData
Returns the metric unit.- Specified by:
getUnit
in interfaceMetricData
-
getType
Description copied from interface:MetricData
Returns the type of this metric.- Specified by:
getType
in interfaceMetricData
-
getData
Description copied from interface:MetricData
Returns the unconstrained metric data.Most will instead prefer to access the constrained metric data after first checking the
MetricData.getType()
:// if (metricData.getType() == MetricDataType.LONG_SUM) { // SumData<LongPointData> sumData = metricData.getLongSumData(); // ... // Process long sum data // }
- Specified by:
getData
in interfaceMetricData
- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:MetricData
Returnstrue
if there are no points associated with this metric.- Specified by:
isEmpty
in interfaceMetricData
-