Benchee v0.5.0 Benchee.Conversion.Format behaviour

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

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

Functions

format(number, module)

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{ ... } }
format(count, label, separator)

Formats a unit value with specified label and separator

Callbacks

format(number)
format(number) :: String.t

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