Interface DefaultAggregationSelector
- 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 default
Aggregation based on InstrumentType.- Since:
- 1.16.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultAggregationSelectorThe default implementation ofDefaultAggregationSelectorwhich returns the default aggregation for each instrument.getDefaultAggregation(InstrumentType instrumentType) Return the default aggregation for theInstrumentType.default DefaultAggregationSelectorwith(InstrumentType instrumentType, Aggregation aggregation) Returns a default aggregation selector which returns the givenaggregationfor the giveninstrumentType, and defers to this for other instrument types.
-
Method Details
-
getDefault
The default implementation ofDefaultAggregationSelectorwhich returns the default aggregation for each instrument. -
with
Returns a default aggregation selector which returns the givenaggregationfor the giveninstrumentType, and defers to this for other instrument types.For example, the following produces a selector which drops histograms and uses the default aggregation for other instruments:
// DefaultAggregationSelector selector = // DefaultAggregationSelector.getDefault() // .with(InstrumentType.HISTOGRAM, Aggregation.drop());- Since:
- 1.16.0
-
getDefaultAggregation
Return the default aggregation for theInstrumentType.The default aggregation is used when an instrument does not match any views.
-