doctype html
html
head
meta charset="UTF-8"
title Speed Gun: #{@profiler.path}
link(rel="stylesheet" href="#{SpeedGun.config.prefix}/style.css")
script(type="text/javascript" src="#{SpeedGun.config.prefix}/jquery-1.10.2.min.js")
script(type="text/javascript" src="#{SpeedGun.config.prefix}/profile.js")
body
#header
h1 #{h @profiler.path}?#{h @profiler.query}
dl
dt Request ID
dd= @profiler.id
dt Requested At
dd= @profiler.requested_at.strftime("%Y-%m-%d %H:%M:%S")
- if @profiler.browser
- browser = @profiler.browser
div#browser
h2 Browser
.browser.user_agent
h3 User Agent: #{h browser.user_agent.browser}
.more
dl
dt Version
dd= browser.user_agent.version || 'Unknown'
- if browser.user_agent.respond_to?(:build)
dt Build
dd= browser.user_agent.build
- if browser.user_agent.respond_to?(:webkit)
dt Webkit
dd= browser.user_agent.webkit
dt OS
dd= browser.user_agent.os || 'Unknown'
dt Platform
dd= browser.user_agent.platform || 'Unknown'
pre= browser.user_agent
.browser.navigation
h3 Navigation: #{h browser.navigation.type}
.more
dl
dt Type
dd #{h browser.navigation.type}(#{h browser.navigation[:type]})
dt Redirect Count
dd= browser.navigation.redirect_count
.browser.timing
.elapsed-time #{h browser.timing.load_time}ms
h3 Timing
.more
.timing-bars
- browser.timing.timings.each do |timing|
.timing
.timing-bar(style="left: #{h (timing.started_at / (browser.timing.load_time * 1.0)) * 100}%; width: #{h (timing.elapsed_time / (browser.timing.load_time * 1.0)) * 100}%")
.timing-label
= timing.name
| : #{h timing.elapsed_time}ms(+#{h timing.started_at}ms)
div#profiles
h2 Profiles
- last_profile_id = nil
- profile_nest = []
- @profiler.profiles.each do |profile|
- if last_profile_id && profile.parent_profile_id == last_profile_id
- profile_nest.push(last_profile_id)
- while profile.parent_profile_id != profile_nest.last
- profile_nest.pop
div.profile(class="type-#{h profile.type}" style="margin-left: #{h profile_nest.length * 10}px;")
p.elapsed-time
= sprintf("%0.2f", BigDecimal("#{h profile.elapsed_time * 1000}").floor(2))
| ms
h3 #{h profile.label}: #{h profile.title}
.more
dl
dt Profile ID
dd= profile.id
- if profile.parent_profile_id
dt Parent Profile ID
dd= profile.parent_profile_id
== profile.html
ul.backtrace
- profile.backtrace.each do |backtrace|
li= backtrace
- if profile.backtrace.empty?
li No Backtraces
- last_profile_id = profile.id
div#rack-envs
h2 Rack ENVs
ul
- @profiler.env.each_pair do |key, val|
li.env
span.env-key= key
span.env-val= val.inspect