Class: Rack::PerftoolsProfiler::StartProfiling
- Includes:
- Utils
- Defined in:
- lib/rack/perftools_profiler/start_profiling.rb
Instance Method Summary collapse
- #act ⇒ Object
-
#initialize(*args) ⇒ StartProfiling
constructor
A new instance of StartProfiling.
- #response ⇒ Object
Methods included from Utils
Methods inherited from Action
Constructor Details
#initialize(*args) ⇒ StartProfiling
Returns a new instance of StartProfiling.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rack/perftools_profiler/start_profiling.rb', line 6 def initialize(*args) super request = Rack::Request.new(@env) @mode = let(request.GET['mode']) do |m| if m.nil? || m.empty? nil else m.to_sym end end end |
Instance Method Details
#act ⇒ Object
18 19 20 |
# File 'lib/rack/perftools_profiler/start_profiling.rb', line 18 def act @profiler.start(@mode) end |
#response ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/rack/perftools_profiler/start_profiling.rb', line 22 def response [200, {'Content-Type' => 'text/plain'}, [<<-EOS Profiling is now enabled. Visit the URLS that should be profiled. When you are finished, visit /__stop__, then visit /__data__ to view the results. EOS ]] end |