class PigCI::Report::Memory

Public Class Methods

bytes_in_a_megabyte() click to toggle source
# File lib/pig_ci/report/memory.rb, line 12
def self.bytes_in_a_megabyte
  @bytes_in_a_megabyte ||= BigDecimal("1_048_576")
end
format_row(_unformatted_row) click to toggle source
Calls superclass method PigCI::Report::format_row
# File lib/pig_ci/report/memory.rb, line 2
def self.format_row(_unformatted_row)
  row = super
  row[:max] = (row[:max] / bytes_in_a_megabyte).round(PigCI.report_memory_precision)
  row[:min] = (row[:min] / bytes_in_a_megabyte).round(PigCI.report_memory_precision)
  row[:mean] = (row[:mean] / bytes_in_a_megabyte).round(PigCI.report_memory_precision)
  row[:total] = (row[:total] / bytes_in_a_megabyte).round(PigCI.report_memory_precision)

  row
end