ExTeal.Metric.Value behaviour (ExTeal v0.21.0) View Source
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.
Link to this section Summary
Link to this section Types
Link to this section Callbacks
Specs
calculate(ExTeal.Metric.Request.t()) :: valid_result()
Link to this section Functions
Link to this function
aggregate(metric_module, request, queryable, aggregate_type, field)
View SourceSpecs
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 SourceSpecs
query_for( atom(), module(), ExTeal.Metric.Request.t(), Ecto.Queryable.t(), atom(), atom() ) :: integer() | float()