Class: GoodData::Bricks::BenchMiddleware

Inherits:
Middleware show all
Defined in:
lib/gooddata/bricks/middleware/bench_middleware.rb

Instance Attribute Summary

Attributes inherited from Middleware

#app

Instance Method Summary collapse

Methods inherited from Middleware

#initialize, #load_defaults

Methods included from Utils

#returning

Constructor Details

This class inherits a constructor from GoodData::Bricks::Middleware

Instance Method Details

#call(params) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/gooddata/bricks/middleware/bench_middleware.rb', line 14

def call(params)
  params = params.to_hash
  GoodData.logger.info('Starting timer')
  result = nil
  report = Benchmark.measure { result = @app.call(params) }
  GoodData.logger.info('Stopping timer')
  GoodData.logger.info(report.pretty_inspect)
  result
end