Outputs ruby-prof results as JSON.
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
test
.gitignore
Gemfile
README.textile
Rakefile
ruby_prof-json.gemspec

README.textile

RubyProf/JSON

This is a small project that adds a JSON printer to RubyProf to enable easy processing and querying of profiled sessions. Note that the JSON schema may change.

Usage

For now (at least), usage is limited to scripts that directly call RubyProf’s API (and not the `ruby_prof` script—I can’t see an easy way to register a new formatter without directly manipulating the script).


# Assuming `result` is a RubyProf::Result
printer = RubyProf::JsonPrinter.new(result)
printer.print(output)

Example

See the prime number example.