Sha256: 92c244319161681edcf45fb9147be2978babf314e3bde49d77a7f8118f526877
Contents?: true
Size: 731 Bytes
Versions: 20
Compression:
Stored size: 731 Bytes
Contents
require 'stackprof' require_relative '../lib/enhanced/enhanced' # Adjust the path if necessary # gem install stackprof # adjust path as needed # ruby ./lib/core_ext/enhanced/benchmark/stackprofile.rb # dumps to current folder. read the stackprof dump: # stackprof stackprof.dump # Define the number of iterations ITERATIONS = 10_000 def run_with_enhanced_errors EnhancedErrors.enhance_exceptions!(debug: false, override_messages: true) ITERATIONS.times do begin raise 'Test exception with EnhancedErrors' rescue => _e # Exception handled with EnhancedErrors. end end end def stackprofile StackProf.run(mode: :wall, out: 'stackprof.dump') do run_with_enhanced_errors end end stackprofile
Version data entries
20 entries across 20 versions & 1 rubygems