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 MetricDataGet 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.booleanisEmpty()Returnstrueif there are no points associated with this metric.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:MetricDataReturns the metricResource.The
Resourceis configured viaSdkMeterProviderBuilder.setResource(Resource).- Specified by:
getResourcein interfaceMetricData
-
getInstrumentationScopeInfo
Description copied from interface:MetricDataReturns the metricInstrumentationScopeInfo.The
InstrumentationScopeInfois determined from the options used whenMeterBuilder.build()ing theMeter.- Specified by:
getInstrumentationScopeInfoin interfaceMetricData
-
getName
Description copied from interface:MetricDataReturns the metric name.The metric name is typically the instrument name, but may be optionally overridden by a
View.- Specified by:
getNamein interfaceMetricData
-
getDescription
Description copied from interface:MetricDataReturns the metric description.The metric name is typically the instrument description, but may be optionally overridden by a
View.- Specified by:
getDescriptionin interfaceMetricData
-
getUnit
Description copied from interface:MetricDataReturns the metric unit.- Specified by:
getUnitin interfaceMetricData
-
getType
Description copied from interface:MetricDataReturns the type of this metric.- Specified by:
getTypein interfaceMetricData
-
getData
Description copied from interface:MetricDataReturns 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:
getDatain interfaceMetricData- See Also:
-
isEmpty
public boolean isEmpty()Description copied from interface:MetricDataReturnstrueif there are no points associated with this metric.- Specified by:
isEmptyin interfaceMetricData
-