View Source ExTeal.Metric.Value behaviour (ExTeal v0.28.1)
Value Metrics display a single value and it's change compared to a previous interval of time. For example, a value metric might display the total number of blog posts created in the last thirty days, versus the previous thirty days.
Once generated, a value metric module has two functions that can be customized,
a calculate/1
and a ranges/0
function.
Additionally there are modifier functions that change the behavior and display of the metric.
Summary
Types
Callbacks
@callback calculate(ExTeal.Metric.Request.t()) :: valid_result()
Functions
Link to this function
aggregate(metric_module, request, queryable, aggregate_type, field)
View Source@spec aggregate( module(), ExTeal.Metric.Request.t(), Ecto.Queryable.t(), atom(), atom() ) :: map()
Link to this function
query_for(current, metric, request, queryable, aggregate_type, field)
View Source@spec query_for( atom(), module(), ExTeal.Metric.Request.t(), Ecto.Queryable.t(), atom(), atom() ) :: integer() | float()