Sha256: 876f5835c8dce276d87660029c34b5768da9ea873ed6c6c7ac649c4f2ae16483

Contents?: true

Size: 631 Bytes

Versions: 25

Compression:

Stored size: 631 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require 'benchmark'
require_relative 'base_middleware'
require 'pp'

module GoodData
  module Bricks
    class BenchMiddleware < Bricks::Middleware
      def call(params)
        params = params.to_hash
        puts 'Starting timer'
        result = nil
        report = Benchmark.measure { result = @app.call(params) }
        puts 'Stopping timer'
        pp report
        result
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
gooddata-0.6.54 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-0.6.53 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-0.6.52 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-0.6.51 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-0.6.50 lib/gooddata/bricks/middleware/bench_middleware.rb