Sha256: 6969fc824b01ed527fe8ac696747fc5335dac2876c3e5d7fe048146e7a3d6f94

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2015 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

3 entries across 3 versions & 1 rubygems

Version Path
gooddata-bricks-0.8.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-bricks-0.7.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-bricks-0.6.0 lib/gooddata/bricks/middleware/bench_middleware.rb