class Benchmark::Memory::Job::IOOutput::MetricFormatter

Format metrics for use with the IOOutput.

def allocated_message

Returns:
  • (String) - the formated string for allocated memory
def allocated_message
  format(
    '%<allocated>s %<type>s',
    allocated: scale(metric.allocated),
    type: metric.type
  )
end

def initialize(metric)

Parameters:
  • metric (Measurement::Metric) -- The metric to format.
def initialize(metric)
  @metric = metric
end

def retained_message

Returns:
  • (String) - the formated string for retained memory
def retained_message
  format(
    '(%<retained>s retained)',
    retained: scale(metric.retained)
  )
end

def to_s

Returns:
  • (String) -
def to_s
  [allocated_message, retained_message].join(' ')
end