class Benchmark::Memory::Measurement

Encapsulate the combined metrics of an action.

def self.from_result(result)

Parameters:
  • result (MemoryProfiler::Results) --
def self.from_result(result)
  memory = MetricExtractor.extract_memory(result)
  objects = MetricExtractor.extract_objects(result)
  strings = MetricExtractor.extract_strings(result)
  new(memory: memory, objects: objects, strings: strings)
end

def initialize(memory:, objects:, strings:)

Parameters:
  • strings (Metric) -- The string allocations of an action.
  • objects (Metric) -- The object allocations of an action.
  • memory (Metric) -- The memory usage of an action.
def initialize(memory:, objects:, strings:)
  @memory = memory
  @objects = objects
  @strings = strings
  @metrics = [@memory, @objects, @strings]
end