Skip to content

Commit

Permalink
Better description of 'Other' steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruce Williams committed Sep 19, 2008
1 parent 9d6c05a commit 308f4b8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 40 additions & 1 deletion lib/fiveruns_tuneup_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def initialize(name, layer, raw_extras = {}, time = nil)
def children_with_disparity
return children if children.empty?
layer_name = layer if respond_to?(:layer)
extra_step = Step.new('(Other)', layer_name, {}, disparity)
extra_step = DisparityStep.new(layer_name, disparity)
extra_step.parent = parent
children + [extra_step]
end
Expand Down Expand Up @@ -282,6 +282,45 @@ def template

end

class DisparityStep < Step

def initialize(layer_name, disparity)
super '(Other)', layer_name, {}, disparity
@extras = build_extras description
end

private

def description
{
'What is this?' => %(
<p>
<b>Other</b> is the amount of time spent executing
code that TuneUp doesn't wrap to extract more information.
To reduce overhead and make the listing more
manageable, we don't generate steps for every operation.
</p>
<p>#{layer_description}</p>
)
}
end

def layer_description
case layer
when :model
"In the <i>model</i> layer, this is probably ORM overhead, out of your control."
when :view
"In the <i>view</i> layer, this is probably framework overhead during render, out of your control."
when :controller
%(
In the <i>controller</i> layer, this is probably framework overhead during action execution (out of your control),
or time spent executing your code in the action (calls to private methods, libraries, etc).
)
end
end

end

class Bar
include Templating

Expand Down
2 changes: 2 additions & 0 deletions public/stylesheets/tuneup.css
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ version: 2.5.1
background: none;
width: 600px;
}
#tuneup p { background: none; font-family: sans-serif; margin: 9px 0; }
#tuneup dt { font-weight: bold; }
#tuneup dd { color: #000; font-family:monospace; *font-size:108%; line-height:100%; }
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras .tuneup-app-line { text-decoration: underline; background: #ffa; }
#tuneup #tuneup-details li.fiveruns_tuneup_step .tuneup-step-extras a.tuneup-close-link { float: right; font-family: sans-serif; color: red; }
Expand Down

0 comments on commit 308f4b8

Please sign in to comment.