Benchee v0.11.0 Benchee.Conversion.Format behaviour View Source

Functions for formatting values and their unit labels. Different domains handle this task differently, for example durations and counts.

See Benchee.Conversion.Count and Benchee.Conversion.Duration for examples

Link to this section Summary

Functions

Scales a number to the most appropriate unit as defined in module, and formats the scaled value with a label. The module should provide a units/0 function that returns a Map like

Formats a unit value with specified label and separator

Callbacks

Formats a number as a string, with a unit label. See Benchee.Conversion.Count and Benchee.Conversion.Duration for examples

Link to this section Functions

Scales a number to the most appropriate unit as defined in module, and formats the scaled value with a label. The module should provide a units/0 function that returns a Map like

%{ :unit_name => %Benchee.Conversion.Unit{ ... } }
Link to this function format(count, label, separator) View Source

Formats a unit value with specified label and separator

Link to this section Callbacks

Link to this callback format(number) View Source
format(number()) :: String.t()

Formats a number as a string, with a unit label. See Benchee.Conversion.Count and Benchee.Conversion.Duration for examples