Sha256: 4591663bf8169d43f7adc5e13c617a40b66bab725216f5e64eb8ce6cc744fedd

Contents?: true

Size: 803 Bytes

Versions: 8

Compression:

Stored size: 803 Bytes

Contents

module Rack::PerftoolsProfiler
  
  class Action

    def initialize(env, profiler, middleware)
      @env = env
      @request = Rack::Request.new(env)
      @data_params = @request.params.clone
      @profiler = profiler
      @middleware = middleware
    end
    
    def act
      # do nothing
    end

    def self.for_env(env, profiler, middleware)
      request = Rack::Request.new(env)
      klass = 
        case request.path
        when '/__start__'
          StartProfiling
        when '/__stop__'
          StopProfiling
        when '/__data__'
          ReturnData
        else
          if ProfileOnce.has_special_param?(request)
            ProfileOnce
          else
            CallAppDirectly
          end
        end
      klass.new(env, profiler, middleware)
    end

  end

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rack-perftools_profiler-0.2.1 lib/rack/perftools_profiler/action.rb
rack-perftools_profiler-0.2.0 lib/rack/perftools_profiler/action.rb
rack-perftools_profiler-0.1.1 lib/rack/perftools_profiler/action.rb
rack-perftools_profiler-0.1.0 lib/rack/perftools_profiler/action.rb
aleksi-rack-perftools_profiler-0.0.4 lib/rack/perftools_profiler/action.rb
aleksi-rack-perftools_profiler-0.0.3 lib/rack/perftools_profiler/action.rb
rack-perftools_profiler-0.0.2 lib/rack/perftools_profiler/action.rb
rack-perftools_profiler-0.0.1 lib/rack/perftools_profiler/action.rb