public class AggregationAverageMaker extends MetricMaker
The constructed metric takes aggregated data from a finer time grain (i.e. DefaultTimeGrain.DAY) and computes an average across a coarser time grain (i.e. DefaultTimeGrain.WEEK). For example, given the total number of visitors to www.example.com for each day of the week, we can compute the average number of daily visitors to example.com for the entire week.
A nested average requires the following columns:
Modifier and Type | Field and Description |
---|---|
static PostAggregation |
COUNT_FIELD_OUTER |
static PostAggregation |
COUNT_INNER |
static Aggregation |
COUNT_OUTER |
metrics, NO_OP_MAP_PROVIDER, NO_OP_MAPPER
Constructor and Description |
---|
AggregationAverageMaker(MetricDictionary metrics,
ZonelessTimeGrain innerGrain)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected int |
getDependentMetricsRequired()
Get the number of dependent metrics the maker requires for making the metric.
|
protected LogicalMetric |
makeInner(LogicalMetricInfo logicalMetricInfo,
List<String> dependentMetrics)
Delegated to for actually making the metric.
|
assertDependentMetricsExist, assertRequiredDependentMetricCount, getDependentQuery, getMergedQuery, getNumericField, getNumericField, getSketchField, getSketchField, make, make, make, makeInner
public static final PostAggregation COUNT_INNER
@NotNull public static final Aggregation COUNT_OUTER
public static final PostAggregation COUNT_FIELD_OUTER
public AggregationAverageMaker(MetricDictionary metrics, ZonelessTimeGrain innerGrain)
metrics
- A mapping of metric names to the corresponding LogicalMetrics. Used to resolve metric names
when making the logical metric.innerGrain
- The time grain across which queries should aggregate.protected LogicalMetric makeInner(LogicalMetricInfo logicalMetricInfo, List<String> dependentMetrics)
MetricMaker
makeInner
in class MetricMaker
logicalMetricInfo
- Logical metric info providerdependentMetrics
- Metrics this metric depends onprotected int getDependentMetricsRequired()
MetricMaker
getDependentMetricsRequired
in class MetricMaker
Copyright © 2016–2018 Yahoo! Inc.. All rights reserved.