public class MappingAggregatorsRouter extends java.lang.Object implements AggregatorsRouter
AggregatorsRouter implementation based on routing map,
Metric ids in routing map may contain wildcards.
Routing map should contain route with key "__default".
Its possible to have only "__default" route.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_ROUTE_NAME |
| Constructor and Description |
|---|
MappingAggregatorsRouter(java.util.Map<java.lang.String,java.util.List<MetricsAggregator>> aggregators)
Requires routing map with "__default" key route at least.
|
| Modifier and Type | Method and Description |
|---|---|
void |
aggregate(java.lang.String metricIdentifier,
java.util.function.Consumer<MetricsAggregator> function)
Matches list of aggregators either by key or by prefixed key.
|
java.util.List<MetricsAggregator> |
getAggregatorsForMetric(java.lang.String metricIdentifier)
Deprecated.
|
public static final java.lang.String DEFAULT_ROUTE_NAME
public MappingAggregatorsRouter(java.util.Map<java.lang.String,java.util.List<MetricsAggregator>> aggregators)
aggregators - - routing map aggregators@Deprecated public java.util.List<MetricsAggregator> getAggregatorsForMetric(java.lang.String metricIdentifier)
getAggregatorsForMetric in interface AggregatorsRoutermetricIdentifier - - id of metric for that route is defined. Note: id is
already resolved one, in case if MetricsIdentifierResolver
had a match for metric identifier, identifier might be different from initial nameMetricsAggregator that accept metric with id metricIdentifier
if metricIdentifier didnt match any specific routes, default route aggregator list is returned.public void aggregate(java.lang.String metricIdentifier,
java.util.function.Consumer<MetricsAggregator> function)
aggregate in interface AggregatorsRoutermetricIdentifier - - id of metric for that route is defined. Note: id is
already resolved one, in case if MetricsIdentifierResolver
had a match for metric identifier, identifier might be different from initial namefunction - - consumer that should be applied to each of aggregators .