Skip to content

MetricDefinition

Source code in docs_src/capo_appmonetization/types/metric_definition.py
class MetricDefinition(TypedDict, closed=True):
    filters: "capo_appmonetization.types.metric_filter_list.MetricFilterList"
    """The predicates selecting which events contribute to the metric. Combined with logical AND."""
    function: "capo_appmonetization.types.aggregation_function.AggregationFunction"
    """The aggregation function applied to matching events (SUM, COUNT, or MAX)."""
    function_field: NotRequired[
        "capo_appmonetization.types.identifier_field.IdentifierField"
    ]
    """The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT."""
    group_by: "capo_appmonetization.types.group_by_field_list.GroupByFieldList"
    """The event fields to group aggregated results by."""
    period: "capo_appmonetization.types.period_type.PeriodType"
    """The reset or rollup period for the aggregation."""

filters instance-attribute

The predicates selecting which events contribute to the metric. Combined with logical AND.

function instance-attribute

The aggregation function applied to matching events (SUM, COUNT, or MAX).

function_field instance-attribute

function_field: NotRequired[IdentifierField]

The event property key the aggregation function operates on. Required for SUM and MAX; ignored for COUNT.

group_by instance-attribute

group_by: GroupByFieldList

The event fields to group aggregated results by.

period instance-attribute

period: PeriodType

The reset or rollup period for the aggregation.