Interface AggregationTemporalitySelector
- All Known Subinterfaces:
MetricExporter
,MetricReader
- All Known Implementing Classes:
PeriodicMetricReader
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface that selects
AggregationTemporality
based on InstrumentType
.- Since:
- 1.14.0
-
Method Summary
Modifier and TypeMethodDescriptionA common implementation ofAggregationTemporalitySelector
which returnsAggregationTemporality.CUMULATIVE
for all instruments.static String
asString
(AggregationTemporalitySelector selector) Returns a string representation of this selector, for using inObject.toString()
implementations.A common implementation ofAggregationTemporalitySelector
which indicates delta preference.getAggregationTemporality
(InstrumentType instrumentType) Return the aggregation temporality for theInstrumentType
.A common implementation ofAggregationTemporalitySelector
which reduces memory.
-
Method Details
-
alwaysCumulative
A common implementation ofAggregationTemporalitySelector
which returnsAggregationTemporality.CUMULATIVE
for all instruments. -
deltaPreferred
A common implementation ofAggregationTemporalitySelector
which indicates delta preference.AggregationTemporality.DELTA
is returned forInstrumentType.COUNTER
,InstrumentType.OBSERVABLE_COUNTER
, andInstrumentType.HISTOGRAM
.AggregationTemporality.CUMULATIVE
is returned forInstrumentType.UP_DOWN_COUNTER
andInstrumentType.OBSERVABLE_UP_DOWN_COUNTER
. -
lowMemory
A common implementation ofAggregationTemporalitySelector
which reduces memory.AggregationTemporality.DELTA
is returned forInstrumentType.COUNTER
andInstrumentType.HISTOGRAM
.AggregationTemporality.CUMULATIVE
is returned forInstrumentType.UP_DOWN_COUNTER
,InstrumentType.OBSERVABLE_UP_DOWN_COUNTER
, andInstrumentType.OBSERVABLE_COUNTER
.- Since:
- 1.28.0
-
getAggregationTemporality
Return the aggregation temporality for theInstrumentType
. -
asString
Returns a string representation of this selector, for using inObject.toString()
implementations.- Since:
- 1.38.0
-