Interface MetricData
@Immutable
public interface MetricData
A
ImmutableMetricData represents the data exported as part of aggregating one
Instrument.-
Method Summary
Modifier and TypeMethodDescriptionData<?>getData()Returns the description of this metric.default GaugeData<DoublePointData>Returns theDoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.default SumData<DoublePointData>Returns theDoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.default HistogramDataReturns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.io.opentelemetry.sdk.common.InstrumentationScopeInfoReturns the instrumentation scope specified when creating theMeterwhich created theInstrumentthat producesMetricData.default GaugeData<LongPointData>Returns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.default SumData<LongPointData>Returns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.getName()Returns the metric name.io.opentelemetry.sdk.resources.ResourceReturns the resource of thisMetricData.default SummaryDataReturns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.getType()Returns the type of this metric.getUnit()Returns the unit of this metric.default booleanisEmpty()Returnstrueif there are no points associated with this metric.
-
Method Details
-
getResource
io.opentelemetry.sdk.resources.Resource getResource()Returns the resource of thisMetricData.- Returns:
- the resource of this
MetricData.
-
getInstrumentationScopeInfo
io.opentelemetry.sdk.common.InstrumentationScopeInfo getInstrumentationScopeInfo()Returns the instrumentation scope specified when creating theMeterwhich created theInstrumentthat producesMetricData.- Returns:
- an instance of
InstrumentationScopeInfo
-
getName
String getName()Returns the metric name.- Returns:
- the metric name.
-
getDescription
String getDescription()Returns the description of this metric.- Returns:
- the description of this metric.
-
getUnit
String getUnit()Returns the unit of this metric.- Returns:
- the unit of this metric.
-
getType
MetricDataType getType()Returns the type of this metric.- Returns:
- the type of this metric.
-
getData
Data<?> getData() -
isEmpty
default boolean isEmpty()Returnstrueif there are no points associated with this metric.- Returns:
trueif there are no points associated with this metric.
-
getDoubleGaugeData
Returns theDoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.- Returns:
- the
DoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.
-
getLongGaugeData
Returns theLongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.- Returns:
- the
LongGaugeDataif type isMetricDataType.LONG_GAUGE, otherwise a default empty data.
-
getDoubleSumData
Returns theDoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.- Returns:
- the
DoubleSumDataif type isMetricDataType.DOUBLE_SUM, otherwise a default empty data.
-
getLongSumData
Returns theLongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.- Returns:
- the
LongSumDataif type isMetricDataType.LONG_SUM, otherwise a default empty data.
-
getSummaryData
Returns theDoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.- Returns:
- the
DoubleSummaryDataif type isMetricDataType.SUMMARY, otherwise a default * empty data.
-
getHistogramData
Returns theDoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.- Returns:
- the
DoubleHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.
-