Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bill Kayser
committed
Oct 17, 2009
1 parent
51dcc2c
commit 932afa0
Showing
14 changed files
with
352 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
167 changes: 85 additions & 82 deletions
167
classes/NewRelic/Agent/Instrumentation/ControllerInstrumentation.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<?xml version="1.0" encoding="iso-8859-1"?> | ||
<!DOCTYPE html | ||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<title>Module: NewRelic::Agent::Instrumentation::Sinatra</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | ||
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | ||
<link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" /> | ||
<script type="text/javascript"> | ||
// <![CDATA[ | ||
|
||
function popupCode( url ) { | ||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") | ||
} | ||
|
||
function toggleCode( id ) { | ||
if ( document.getElementById ) | ||
elem = document.getElementById( id ); | ||
else if ( document.all ) | ||
elem = eval( "document.all." + id ); | ||
else | ||
return false; | ||
|
||
elemStyle = elem.style; | ||
|
||
if ( elemStyle.display != "block" ) { | ||
elemStyle.display = "block" | ||
} else { | ||
elemStyle.display = "none" | ||
} | ||
|
||
return true; | ||
} | ||
|
||
// Make codeblocks hidden by default | ||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) | ||
|
||
// ]]> | ||
</script> | ||
|
||
</head> | ||
<body> | ||
|
||
|
||
|
||
<div id="classHeader"> | ||
<table class="header-table"> | ||
<tr class="top-aligned-row"> | ||
<td><strong>Module</strong></td> | ||
<td class="class-name-in-header">NewRelic::Agent::Instrumentation::Sinatra</td> | ||
</tr> | ||
<tr class="top-aligned-row"> | ||
<td><strong>In:</strong></td> | ||
<td> | ||
<a href="../../../../files/lib/new_relic/agent/instrumentation/sinatra_rb.html"> | ||
lib/new_relic/agent/instrumentation/sinatra.rb | ||
</a> | ||
<br /> | ||
</td> | ||
</tr> | ||
|
||
</table> | ||
</div> | ||
<!-- banner header --> | ||
|
||
<div id="bodyContent"> | ||
|
||
|
||
|
||
<div id="contextContent"> | ||
|
||
|
||
|
||
</div> | ||
|
||
<div id="method-list"> | ||
<h3 class="section-bar">Methods</h3> | ||
|
||
<div class="name-list"> | ||
<a href="#M000143">route_eval_with_newrelic</a> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
|
||
<!-- if includes --> | ||
<div id="includes"> | ||
<h3 class="section-bar">Included Modules</h3> | ||
|
||
<div id="includes-list"> | ||
<span class="include-name"><a href="ControllerInstrumentation.html">NewRelic::Agent::Instrumentation::ControllerInstrumentation</a></span> | ||
</div> | ||
</div> | ||
|
||
<div id="section"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
<!-- if method_list --> | ||
<div id="methods"> | ||
<h3 class="section-bar">Public Instance methods</h3> | ||
|
||
<div id="method-M000143" class="method-detail"> | ||
<a name="M000143"></a> | ||
|
||
<div class="method-heading"> | ||
<a href="#M000143" class="method-signature"> | ||
<span class="method-name">route_eval_with_newrelic</span><span class="method-args">(&block_arg)</span> | ||
</a> | ||
</div> | ||
|
||
<div class="method-description"> | ||
<p><a class="source-toggle" href="#" | ||
onclick="toggleCode('M000143-source');return false;">[Source]</a></p> | ||
<div class="method-source-code" id="M000143-source"> | ||
<pre> | ||
<span class="ruby-comment cmt"># File lib/new_relic/agent/instrumentation/sinatra.rb, line 13</span> | ||
13: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route_eval_with_newrelic</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block_arg</span>) | ||
14: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">unescape</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">path_info</span>) | ||
15: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">path</span> | ||
16: <span class="ruby-comment cmt"># Go through each route and look for a match</span> | ||
17: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">routes</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">routes</span>[<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">request_method</span>] | ||
18: <span class="ruby-identifier">routes</span>.<span class="ruby-identifier">detect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">pattern</span>, <span class="ruby-identifier">keys</span>, <span class="ruby-identifier">conditions</span>, <span class="ruby-identifier">block</span><span class="ruby-operator">|</span> | ||
19: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_arg</span>.<span class="ruby-identifier">equal?</span> <span class="ruby-identifier">block</span> | ||
20: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">source</span> | ||
21: <span class="ruby-keyword kw">end</span> | ||
22: <span class="ruby-keyword kw">end</span> | ||
23: <span class="ruby-keyword kw">end</span> | ||
24: <span class="ruby-comment cmt"># strip of leading ^ and / chars and trailing $ and /</span> | ||
25: <span class="ruby-identifier">name</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">%r{^[/^]*(.*?)[/\$]*$}</span>, <span class="ruby-value str">'\1'</span>) | ||
26: <span class="ruby-identifier">name</span> = <span class="ruby-value str">'root'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">empty?</span> | ||
27: <span class="ruby-identifier">perform_action_with_newrelic_trace</span>(<span class="ruby-identifier">:category</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:sinatra</span>, <span class="ruby-identifier">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">name</span>) <span class="ruby-keyword kw">do</span> | ||
28: <span class="ruby-identifier">route_eval_without_newrelic</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block_arg</span>) | ||
29: <span class="ruby-keyword kw">end</span> | ||
30: <span class="ruby-keyword kw">end</span> | ||
</pre> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
</div> | ||
|
||
|
||
</div> | ||
|
||
|
||
<div id="validator-badges"> | ||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.