View Source Peep.Buckets behaviour (peep v2.0.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.

Link to this section Summary

Link to this section Types

@type config() :: map()

Link to this section 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()

Link to this section Functions