Interface MetricData
-
- All Known Implementing Classes:
AutoValue_ImmutableMetricData,EmptyMetricData,ImmutableMetricData
@Immutable public interface MetricDataMetric 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.StringgetDescription()Returns the metric description.default GaugeData<DoublePointData>getDoubleGaugeData()Returns thedoubleGaugeDataif type isMetricDataType.DOUBLE_GAUGE, otherwise a default empty data.default SumData<DoublePointData>getDoubleSumData()default ExponentialHistogramDatagetExponentialHistogramData()Returns theExponentialHistogramDataif type isMetricDataType.EXPONENTIAL_HISTOGRAM, otherwise a default empty data.default HistogramDatagetHistogramData()Returns theHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.InstrumentationScopeInfogetInstrumentationScopeInfo()Returns the metricInstrumentationScopeInfo.default GaugeData<LongPointData>getLongGaugeData()default SumData<LongPointData>getLongSumData()java.lang.StringgetName()Returns the metric name.ResourcegetResource()Returns the metricResource.default SummaryDatagetSummaryData()Returns theSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.MetricDataTypegetType()Returns the type of this metric.java.lang.StringgetUnit()Returns the metric unit.default booleanisEmpty()Returnstrueif there are no points associated with this metric.
-
-
-
Method Detail
-
getResource
Resource getResource()
Returns the metricResource.The
Resourceis configured viaSdkMeterProviderBuilder.setResource(Resource).
-
getInstrumentationScopeInfo
InstrumentationScopeInfo getInstrumentationScopeInfo()
Returns the metricInstrumentationScopeInfo.The
InstrumentationScopeInfois 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()
Returnstrueif there are no points associated with this metric.
-
getDoubleGaugeData
default GaugeData<DoublePointData> getDoubleGaugeData()
Returns thedoubleGaugeDataif 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 theSummaryDataif type isMetricDataType.SUMMARY, otherwise a default empty data.
-
getHistogramData
default HistogramData getHistogramData()
Returns theHistogramDataif type isMetricDataType.HISTOGRAM, otherwise a default empty data.
-
getExponentialHistogramData
default ExponentialHistogramData getExponentialHistogramData()
Returns theExponentialHistogramDataif type isMetricDataType.EXPONENTIAL_HISTOGRAM, otherwise a default empty data.
-
-