Last active
August 29, 2015 14:05
-
-
Save cue232s/2cc4c2d1baa2439b7640 to your computer and use it in GitHub Desktop.
Profiler not working, What am I doing 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
[22] pry(main)> profile_data = JRuby::Profiler.profile do | |
[22] pry(main)* [*50..1000].collect {|val| val = val + 10} | |
[22] pry(main)* end | |
=> #<Java::OrgJrubyRuntimeProfile::ProfileData:0x63d8669d> | |
[23] pry(main)> profile_printer = JRuby::Profiler::GraphProfilePrinter.new(profile_data) | |
=> #<Java::OrgJrubyRuntimeProfile::GraphProfilePrinter:0x18755efe> | |
[24] pry(main)> profile_printer.printProfile(STDOUT) | |
Total time: 0.00 | |
%total %self total self children calls name | |
--------------------------------------------------------------------------------------------------------- | |
100% 0% 0.00 0.00 0.00 1 (top) | |
0.00 0.00 0.00 1/1 Array#collect | |
0.00 0.00 0.00 1/1 Range#to_a | |
--------------------------------------------------------------------------------------------------------- | |
0.00 0.00 0.00 1/1 (top) | |
94% 85% 0.00 0.00 0.00 1 Array#collect | |
0.00 0.00 0.00 951/951 Fixnum#+ | |
--------------------------------------------------------------------------------------------------------- | |
0.00 0.00 0.00 951/951 Array#collect | |
9% 9% 0.00 0.00 0.00 951 Fixnum#+ | |
--------------------------------------------------------------------------------------------------------- | |
0.00 0.00 0.00 1/1 (top) | |
5% 5% 0.00 0.00 0.00 1 Range#to_a | |
=> nil | |
[25] pry(main)> |
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
Total time: 0.00 | |
%total %self total self children calls name | |
--------------------------------------------------------------------------------------------------------- | |
100% 100% 0.00 0.00 0.00 0 (top) | |
Started GET "/v1/some" for 127.0.0.1 at 2014-08-28 16:47:56 +0000 | |
Processing by V1::SomeController#index as JSON | |
Parameters: {"some"=>{}} | |
Rendered text template (0.0ms) | |
Completed 200 OK in 18.0ms (Views: 15.0ms | ActiveRecord: 0.0ms) |
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
equire 'jruby/profiler' | |
module V1 | |
class SomeController < PublicController | |
def index | |
profile_data = JRuby::Profiler.profile do | |
[*50..1000].collect {|val| val = val + 10} | |
end | |
profile_printer = JRuby::Profiler::GraphProfilePrinter.new(profile_data) | |
gff = File.open('graph.txt.' + Time.now.to_s.delete(' '), 'w') | |
profile_printer.printProfile(gff) | |
render text: profile_printer.printProfile(STDOUT) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment