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

Series wrapper for timeseries data with pipe-friendly processing capabilities.

Terminal operations return computed values:

series
|> aggregate_sum("count")
|> then(&IO.inspect(&1, label: "Total Count"))

timeline_data = series |> format_timeline("count")
categories = series |> format_category("status")

Transformation operations return a new %Trifle.Stats.Series{}:

new_series = series
|> transform_expression(["sum", "count"], "a / b", "avg")
|> transform_expression(["success", "total"], "(a / b) * 100", "success_rate")

result = series
|> transform_expression(["sum", "count"], "a / b", "avg")
|> transform_expression(["success", "total"], "(a / b) * 100", "rate")
|> aggregate_max("rate")

Summary

Functions

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_sum(series, path, slices \\ 1)

View Source
Link to this function

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

View Source
Link to this function

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

View Source
Link to this function

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

View Source