Skip to content

Commit

Permalink
add back logic for handling results/snapshot/flamegraph. not sure why…
Browse files Browse the repository at this point in the history
… i removed it in b293550
  • Loading branch information
technicalpickles committed Feb 15, 2024
1 parent 4ac9e5a commit ad0e684
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/mini_profiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,18 @@ def call(env)
# handle all /mini-profiler requests here
if path.start_with? @config.base_url_path
file_name = path.sub(@config.base_url_path, '')

case file_name
when 'results'
return serve_results(env)
when 'snapshots'
self.current = nil
return serve_snapshot(env)
when 'flamegraph'
return serve_flamegraph(env)
else
return client_settings.handle_cookie(serve_file(env, file_name: file_name))
end
end

if query_settings.manual_disable? || client_settings.disable_profiling?
Expand All @@ -202,7 +214,6 @@ def call(env)
# remember that profiling is not disabled (ie enabled)
client_settings.disable_profiling = false

# profile gc
if query_settings.profile_gc?
current.measure = false if current
return serve_profile_gc(env, client_settings)
Expand Down

0 comments on commit ad0e684

Please sign in to comment.