Skip to content

Functions

metric-hub

Pre-defined functions that can be used in select expressions across all metrics and segment definitions. These functions are defined in metric-hub

agg_sum

Sum

Calculates the sum of the select expression

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db81d80>, definition='COALESCE(SUM({select_expr}), 0)')

agg_any

Any

Returns true if any of the boolean selected values are TRUE, otherwise FALSE

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db81f30>, definition='COALESCE(LOGICAL_OR({select_expr}), FALSE)')

agg_histogram_mean

Histogram Mean

Computes the mean of the histogram

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db81ea0>, definition='    SAFE_DIVIDE(\n        SUM(CAST(JSON_EXTRACT_SCALAR({select_expr}, "$.sum") AS int64)),\n        SUM((SELECT SUM(value) FROM UNNEST(mozfun.hist.extract({select_expr}).values)))\n    )\n')

agg_hist_zero_fract

Histogram Zero Fraction

Computes the fraction of entries in a Histogram which are zero

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db81cf0>, definition='    SAFE_DIVIDE(\n        SUM(mozfun.map.get_key(mozfun.hist.extract({select_expr}).values,0)),\n        SUM(mozfun.hist.threshold_count({select_expr},1))\n    )\n')

jetstream-config

Pre-defined functions that can be used in select expressions across all metrics and segment definitions. These functions are defined in jetstream-config

agg_sum

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db829e0>, definition='COALESCE(SUM({select_expr}), 0)')

agg_any

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db828c0>, definition='COALESCE(LOGICAL_OR({select_expr}), FALSE)')

agg_histogram_mean

Definition:
functools.partial(<function FunctionsSpec.from_dict.<locals>.<dictcomp>.<lambda> at 0x7f742db82f80>, definition='    SAFE_DIVIDE(\n        SUM(CAST(JSON_EXTRACT_SCALAR({select_expr}, "$.sum") AS int64)),\n        SUM((SELECT SUM(value) FROM UNNEST(mozfun.hist.extract({select_expr}).values)))\n    )\n')