View Source Peep.Buckets behaviour (peep v3.2.1)

A behavior for histogram bucketing strategies.

If no bucketing strategy is provided (i.e. peep_bucket_calculator is not set in :reporter_options for a %Telemetry.Metrics.Distribution{}, then the default is Elixir.Peep.Buckets.Exponential.

If you want custom bucket boundaries, there is Peep.Buckets.Custom, which uses pattern matching to assign sample measurements to buckets.

Summary

Types

@type config() :: map()

Callbacks

Link to this callback

bucket_for(number, config)

View Source
@callback bucket_for(number(), config()) :: non_neg_integer()
@callback config(Telemetry.Metrics.Distribution.t()) :: config()
Link to this callback

number_of_buckets(config)

View Source
@callback number_of_buckets(config()) :: pos_integer()
Link to this callback

upper_bound(non_neg_integer, config)

View Source
@callback upper_bound(non_neg_integer(), config()) :: String.t()

Functions