Sha256: 589555e8aa2d5d618f4a52a02d261d23533d9cf0166bbe04c285893e8de8c138

Contents?: true

Size: 302 Bytes

Versions: 10

Compression:

Stored size: 302 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.group_by(:sourcefile, :sourceline, :class).to_text

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_group_by.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/allocation_stats-0.1.5/examples/trace_my_class_group_by.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/allocation_stats-0.1.5/examples/trace_my_class_group_by.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/allocation_stats-0.1.5/examples/trace_my_class_group_by.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/allocation_stats-0.1.5/examples/trace_my_class_group_by.rb
allocation_stats-0.1.5 examples/trace_my_class_group_by.rb
allocation_stats-0.1.4 examples/trace_my_class_group_by.rb
allocation_stats-0.1.3 examples/trace_my_class_group_by.rb
allocation_stats-0.1.2 examples/trace_my_class_group_by.rb
allocation_stats-0.1.1 examples/trace_my_class_group_by.rb