Class: Memprof::Middleware
- Inherits:
-
Object
- Object
- Memprof::Middleware
- Defined in:
- lib/memprof/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, opts = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, opts = {}) ⇒ Middleware
Returns a new instance of Middleware.
4 5 6 7 |
# File 'lib/memprof/middleware.rb', line 4 def initialize(app, opts = {}) @app = app = opts end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/memprof/middleware.rb', line 8 def call(env) ret = nil Memprof.track{ ret = @app.call(env) puts puts '-' * 80 puts '-' * 80 if [:force_gc] puts "Forcing GC...." GC.start end } ret end |