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
@callback bucket_for(number(), config()) :: non_neg_integer()
@callback config(Telemetry.Metrics.Distribution.t()) :: config()
@callback number_of_buckets(config()) :: pos_integer()
@callback upper_bound(non_neg_integer(), config()) :: String.t()
Functions
@spec config(Telemetry.Metrics.Distribution.t()) :: {atom(), config()}