Interface MetricData
-
- All Known Implementing Classes:
AutoValue_ImmutableMetricData
,EmptyMetricData
,ImmutableMetricData
@Immutable public interface MetricData
Metric data represents the aggregated measurements of an instrument.- Since:
- 1.14.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Data<?>
getData()
Returns the unconstrained metric data.java.lang.String
getDescription()
Returns the metric description.default GaugeData<DoublePointData>
getDoubleGaugeData()
Returns thedouble
GaugeData
if type isMetricDataType.DOUBLE_GAUGE
, otherwise a default empty data.default SumData<DoublePointData>
getDoubleSumData()
default ExponentialHistogramData
getExponentialHistogramData()
Returns theExponentialHistogramData
if type isMetricDataType.EXPONENTIAL_HISTOGRAM
, otherwise a default empty data.default HistogramData
getHistogramData()
Returns theHistogramData
if type isMetricDataType.HISTOGRAM
, otherwise a default empty data.InstrumentationScopeInfo
getInstrumentationScopeInfo()
Returns the metricInstrumentationScopeInfo
.default GaugeData<LongPointData>
getLongGaugeData()
default SumData<LongPointData>
getLongSumData()
java.lang.String
getName()
Returns the metric name.Resource
getResource()
Returns the metricResource
.default SummaryData
getSummaryData()
Returns theSummaryData
if type isMetricDataType.SUMMARY
, otherwise a default empty data.MetricDataType
getType()
Returns the type of this metric.java.lang.String
getUnit()
Returns the metric unit.default boolean
isEmpty()
Returnstrue
if there are no points associated with this metric.
-
-
-
Method Detail
-
getResource
Resource getResource()
Returns the metricResource
.The
Resource
is configured viaSdkMeterProviderBuilder.setResource(Resource)
.
-
getInstrumentationScopeInfo
InstrumentationScopeInfo getInstrumentationScopeInfo()
Returns the metricInstrumentationScopeInfo
.The
InstrumentationScopeInfo
is determined from the options used whenMeterBuilder.build()
ing theMeter
.
-
getName
java.lang.String getName()
Returns the metric name.The metric name is typically the instrument name, but may be optionally overridden by a
View
.
-
getDescription
java.lang.String getDescription()
Returns the metric description.The metric name is typically the instrument description, but may be optionally overridden by a
View
.
-
getUnit
java.lang.String getUnit()
Returns the metric unit.
-
getType
MetricDataType getType()
Returns the type of this metric.
-
getData
Data<?> getData()
Returns the unconstrained metric data.Most will instead prefer to access the constrained metric data after first checking the
getType()
:// if (metricData.getType() == MetricDataType.LONG_SUM) { // SumData<LongPointData> sumData = metricData.getLongSumData(); // ... // Process long sum data // }
-
isEmpty
default boolean isEmpty()
Returnstrue
if there are no points associated with this metric.
-
getDoubleGaugeData
default GaugeData<DoublePointData> getDoubleGaugeData()
Returns thedouble
GaugeData
if type isMetricDataType.DOUBLE_GAUGE
, otherwise a default empty data.
-
getLongGaugeData
default GaugeData<LongPointData> getLongGaugeData()
-
getDoubleSumData
default SumData<DoublePointData> getDoubleSumData()
-
getLongSumData
default SumData<LongPointData> getLongSumData()
-
getSummaryData
default SummaryData getSummaryData()
Returns theSummaryData
if type isMetricDataType.SUMMARY
, otherwise a default empty data.
-
getHistogramData
default HistogramData getHistogramData()
Returns theHistogramData
if type isMetricDataType.HISTOGRAM
, otherwise a default empty data.
-
getExponentialHistogramData
default ExponentialHistogramData getExponentialHistogramData()
Returns theExponentialHistogramData
if type isMetricDataType.EXPONENTIAL_HISTOGRAM
, otherwise a default empty data.
-
-