Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Outputs ruby-prof results as JSON.
Ruby
tree: e8cc9f3d31

Fetching latest commit…

Cannot retrieve the latest commit at this time

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.

Something went wrong with that request. Please try again.