The following is a list of metric makers that are built-in to Fili. See Configuring Metrics for details on metric makers.
These makers are used to make first-level metrics, and are in a one-to-one mapping to the Druid aggregations.
Additionally, the Fili core libraries support Sketch datatypes and sketch set operations provided by theta sketches in Druid.
SketchCountMaker
- The sketchCount is associated with the sketch aggregationMore details about sketches can be found at http://datasketches.github.io/.
The following makers apply single Druid post-aggregators to queries. They correspond to the Druid post-aggregations
Sketch set operations are supported as well.
SketchSetOperationMaker
- Part of the Druid sketch moduleWe currently support neither the native Druid JavaScript
nor the HyperUnique Cardinality
post aggregators. Fili
supports sketches rather than hyperUnique objects, which handle the same problem domain. JavaScript
post-aggregators
are not considered production-safe in terms of performance or server load.
These makers represent more complex operations which do not correspond directly to a single Druid aggregation or post-aggregation. They might create additional columns, constrain the grain of a druid query, or be a shorthand for an arithmetic expression across aggregations (such as an average).
Currently, we only have one built-in metric maker of this type:
AggregationAverageMaker
:
The AggregationAverageMaker
allows us to aggregate a metric at one granularity, and then take the average of the
aggregated metric across a coarser granularity. For example, suppose we want to compute the daily average page views
for each month of the year 2012. In other words, for each month we first compute the total number of page views for
every day of the month. Then, we take the average of those totals, giving us the daily average page views for that
month. The AggregationAverageMaker
is rather complex, and has its own document
that explains how AggregationAverageMaker
works.1: Technically, CountMaker
does not translate directly to the Druid count aggregation,
because of a bug that existed in Druid when CountMaker
was first implemented. Instead, CountMaker
creates a nested
query. The inner query adds a constant field with a value of 1 to each result row. The outer query then performs a
longSum
on said constant.