Skip to content

Commit

Permalink
Move page_name into its own method
Browse files Browse the repository at this point in the history
  • Loading branch information
nateberkopec committed Jan 2, 2024
1 parent a41679e commit bbc8e70
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/mini_profiler/timer_struct/page.rb
Expand Up @@ -59,7 +59,6 @@ def symbolize_array(array)

def initialize(env)
timer_id = MiniProfiler.generate_id
page_name = env['QUERY_STRING'] != "" ? env['PATH_INFO'] + "?" + env['QUERY_STRING'] : env['PATH_INFO']
started_at = (Time.now.to_f * 1000).to_i
started = (Process.clock_gettime(Process::CLOCK_MONOTONIC) * 1000).to_i
machine_name = env['SERVER_NAME']
Expand Down Expand Up @@ -101,6 +100,14 @@ def name
@attributes[:name]
end

def page_name
if env['QUERY_STRING'] && env['QUERY_STRING'] != ""
env['PATH_INFO'] + "?" + env['QUERY_STRING']
else
env['PATH_INFO']
end
end

def duration_ms
@attributes[:root][:duration_milliseconds]
end
Expand Down

0 comments on commit bbc8e70

Please sign in to comment.