Sha256: b5876c26c82aa61cd23bb0aaf53ce7e13ff7a759faa2d2ce2de4f65129768068

Contents?: true

Size: 329 Bytes

Versions: 10

Compression:

Stored size: 329 Bytes

Contents

class MyClass
  def my_method
    @hash = {2 => "foo", 3 => "bar", 5 => "baz"}
    @string = "quux"
  end
end

require File.join(__dir__, "..", "lib", "allocation_stats")

stats = AllocationStats.trace { MyClass.new.my_method }
puts stats.allocations.to_text(columns: [:sourcefile, :sourceline, :class_path, :method_id, :class])

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/allocation_stats-0.1.5/examples/trace_my_class_raw.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/allocation_stats-0.1.5/examples/trace_my_class_raw.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/allocation_stats-0.1.5/examples/trace_my_class_raw.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/allocation_stats-0.1.5/examples/trace_my_class_raw.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/allocation_stats-0.1.5/examples/trace_my_class_raw.rb
allocation_stats-0.1.5 examples/trace_my_class_raw.rb
allocation_stats-0.1.4 examples/trace_my_class_raw.rb
allocation_stats-0.1.3 examples/trace_my_class_raw.rb
allocation_stats-0.1.2 examples/trace_my_class_raw.rb
allocation_stats-0.1.1 examples/trace_my_class_raw.rb