View Source Trifle.Stats.Series.Fluent (Trifle.Stats v2.5.0)

Fluent helpers for %Trifle.Stats.Series{}.

Aggregations and formatters are terminal operations. The built-in transponder surface is expression-only:

series
|> transpond_expression(["sum", "count"], "a / b", "avg")
|> aggregate_max("avg")

Summary

Functions

Link to this macro

__using__(opts)

View Source (macro)

Import this module to get fluent methods on Series structs.

Link to this function

aggregate_call(series, method_name, args \\ [])

View Source
Link to this function

aggregate_max(series, path, slices \\ 1)

View Source
Link to this function

aggregate_mean(series, path, slices \\ 1)

View Source
Link to this function

aggregate_min(series, path, slices \\ 1)

View Source
Link to this function

aggregate_multiple(series, operations)

View Source

Apply multiple aggregations and return results as a map.

Examples

series |> aggregate_multiple([
  avg: ["count"],
  max: ["duration"],
  sum: ["count", 2]  # with slices
])
# => %{avg: 15.5, max: 200, sum: [10, 20]}
Link to this function

aggregate_sum(series, path, slices \\ 1)

View Source
Link to this function

chain_transpond(series, operations)

View Source
Link to this function

debug_inspect(series, label \\ "Series")

View Source

Debug helper - inspect series data and pass through for chaining.

Examples

series
|> debug_inspect("Before transformation")
|> transpond_expression(["sum", "count"], "a / b", "avg")
|> debug_inspect("After transformation")
|> aggregate_max("avg")
Link to this function

format_call(series, method_name, args \\ [])

View Source
Link to this function

format_category(series, path, slices \\ 1, transform_fn \\ nil)

View Source
Link to this function

format_multiple(series, operations)

View Source

Apply multiple formatters and return results as a map.

Link to this function

format_timeline(series, path, slices \\ 1, transform_fn \\ nil)

View Source
Link to this function

transpond_call(series, method_name, args \\ [])

View Source
Link to this function

transpond_expression(series, paths, expression, response, slices \\ 1)

View Source