sourcery_analytics.metrics.aggregations

Functions to combine the results from multiple nodes into a single result.

class sourcery_analytics.metrics.aggregations.Aggregation(*args, **kwargs)

Bases: Protocol[S_co]

Aggregates metric results into a single result.

sourcery_analytics.metrics.aggregations.average(results: Iterable[MetricResult]) MetricResult

Returns the arithmetic average of the results.

sourcery_analytics.metrics.aggregations.total(results: Iterable[MetricResult]) MetricResult

Returns the arithmetic total of the results.

sourcery_analytics.metrics.aggregations.peak(results: Iterable[MetricResult]) MetricResult

Returns the highest value out of the results.

Note that for strings, this will return the value highest in alphabetical order.