Sha256: 579d9e64f519dd1ebe9ec6f15fd80bbe973a63cf2acb1131757ba1b42ea42bca

Contents?: true

Size: 727 Bytes

Versions: 12

Compression:

Stored size: 727 Bytes

Contents

module PlainApm
  module Extensions
    module ThreadAllocations
      module ActiveSupportEvent
        def start!
          super
          @thread_allocation_count_start = now_thread_allocations
        end

        def finish!
          super
          @thread_allocation_count_finish = now_thread_allocations
        end

        def thread_allocations
          @thread_allocation_count_finish - @thread_allocation_count_start
        end

        if defined?(PlainApm::ObjectTracing)
          def now_thread_allocations
            PlainApm::ObjectTracing.total_thread_allocated_objects
          end
        else
          def now_thread_allocations
            0
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
plain_apm-0.9.2 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.9.1 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.9.0 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.8 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.7 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.6 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.5 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.4 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.3 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.2 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.1 lib/plain_apm/extensions/thread_allocations/active_support_event.rb
plain_apm-0.8.0 lib/plain_apm/extensions/thread_allocations/active_support_event.rb