Project

exec_trace

0.0
No commit activity in last 3 years
No release in over 3 years
Trace your Ruby function's execution path
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

ExecTrace

Trace Ruby code, returning methods that were run, how many times they were called, how long they took to run, and the methods they called.

Installation

Add this line to your application's Gemfile:

gem 'exec_trace'

Usage

require "pp"
require "exec_trace"

result = exec_trace do
  u = User.new
  u.save!
end

pp result

exec_trace returns an array of arrays. Each top-level array is a top-level call in the exec_trace block. Frame consist 4 fields: file name + line number, calls, time in microseconds, and an array of frames that it called.

e.g.

[
  ["/Users/me/exec_trace/test/exec_trace_test.rb:23", 1, 52, [
    ["/Users/me/exec_trace/test/exec_trace_test.rb:24", 5, 2518388, []]
  ]]
]

Developing

  • To compile the C extension: bundle exec rake compile
  • To run the tests bundle exec rake test

License

The gem is available as open source under the terms of the MIT License.