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
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
# On my machine using Ruby 2.0 this give me excellent fidelity of stack trace per 1.2ms
# with this fidelity analysis becomes very powerful
sleep0.0005
end
ensure
quit_sampler=true
Expand DownExpand Up
@@ -345,7 +312,11 @@ def call(env)
ifbacktraces
body.closeifbody.respond_to?:close
returnanalyze(backtraces,page_struct)
ifquery_string =~ /pp=sample/
returnanalyze(backtraces,page_struct)
else
returnflame_graph(backtraces,page_struct)
end
end
Expand DownExpand Up
@@ -447,17 +418,30 @@ def help(client_settings)
pp=no-backtrace #{"(*) "ifclient_settings.backtrace_none?}: don't collect stack traces from all the SQL executed (sticky, use pp=normal-backtrace to enable)
pp=normal-backtrace #{"(*) "ifclient_settings.backtrace_default?}: collect stack traces from all the SQL executed and filter normally
pp=full-backtrace #{"(*) "ifclient_settings.backtrace_full?}: enable full backtraces for SQL executed (use pp=normal-backtrace to disable)
pp=sample : sample stack traces and return a report isolating heavy usage (experimental works best with the stacktrace gem)
pp=sample : sample stack traces and return a report isolating heavy usage (works best on Ruby 2.0)
pp=disable : disable profiling for this session
pp=enable : enable profiling for this session (if previously disabled)
pp=profile-gc: perform gc profiling on this request, analyzes ObjectSpace generated by request (ruby 1.9.3 only)
pp=profile-gc-time: perform built-in gc profiling on this request (ruby 1.9.3 only)
pp=flamegraph: works best on Ruby 2.0, a graph representing sampled activity.
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
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
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