Class: Rack::Profile
- Inherits:
-
Object
- Object
- Rack::Profile
- Defined in:
- lib/rack/profile.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Profile
constructor
A new instance of Profile.
Constructor Details
#initialize(app, options = {}) ⇒ Profile
Returns a new instance of Profile.
8 9 10 11 |
# File 'lib/rack/profile.rb', line 8 def initialize(app, ={}) @app = app = end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
6 7 8 |
# File 'lib/rack/profile.rb', line 6 def app @app end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/rack/profile.rb', line 6 def end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rack/profile.rb', line 13 def call(env) RubyProf.start response = app.call(env) results = RubyProf.stop write_output results, :html, RubyProf::GraphHtmlPrinter write_output results, :text, RubyProf::FlatPrinter write_output results, :tree, RubyProf::CallTreePrinter response end |