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-1.3.3-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.3 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.2-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.2 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.1-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.1 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.3.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.2.1-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.2.1 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.2.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.2.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.1.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.1.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.2-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.2 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.1 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.1-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-1.0.0 lib/gooddata/bricks/middleware/bench_middleware.rb