Sha256: b7262b1eb635003c5567d7b301bed7385e3fcf0239cc7f93dbf2a8f1a17cb891

Contents?: true

Size: 699 Bytes

Versions: 52

Compression:

Stored size: 699 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
        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
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
gooddata-2.3.1-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.3.1 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.3.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.3.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.2.0-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.2.0 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.19-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.19 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.17-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.17 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.15-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.15 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.14-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.14 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.13-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.13 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.12-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.12 lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.11-java lib/gooddata/bricks/middleware/bench_middleware.rb
gooddata-2.1.11 lib/gooddata/bricks/middleware/bench_middleware.rb