You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
jruby -v
jruby 9.1.17.0 (2.3.3) 2018-04-20 d8b1ff9 Java HotSpot(TM) 64-Bit Server VM 10.0.1+10 on 10.0.1+10 +jit [linux-x86_64]
Question
Is there a way to aggregate results from multiple calls to JRuby::Profiler.profile, and view as a single output?
For context, I'm profiling a Roda API endpoint (example code below). So I'd like to make 10,000 GET calls to https://localhost/api/work, hit Ctrl-C on the web server, and see the profile.flat/profile.graph results.
From reading the Profile JRuby, it looks like each JRuby::Profiler.profile call on each GET will generate profile_data, but I can't see a way of aggregating the profile_data together for output on server exit.
Is this possible? If so, it would be great if the wiki page was updated.
Many thanks
class App < Roda
route do |r|
r.on 'work' do
profile_data = JRuby::Profiler.profile do
# code to be profiled
end
end
end
end
# On server shutdown, output aggregated profile data
The text was updated successfully, but these errors were encountered:
not sure if aggregating is needed really to be implemented in general.
you could "aggregate" the profile_data yourself or simply (which is usually how its done) profile at a higher level - somewhere at the framework router level I guess.
@kares thanks for the reply. In the end I just changed the API endpoint to repeat its logic 1000 times inside the profile call. This gave me enough information to debug the API, and avoid needing to aggregate profiling information from multiple API calls. Closing this issue.
Environment
Question
Is there a way to aggregate results from multiple calls to
JRuby::Profiler.profile
, and view as a single output?For context, I'm profiling a Roda API endpoint (example code below). So I'd like to make 10,000 GET calls to https://localhost/api/work, hit Ctrl-C on the web server, and see the profile.flat/profile.graph results.
From reading the Profile JRuby, it looks like each
JRuby::Profiler.profile
call on each GET will generateprofile_data
, but I can't see a way of aggregating the profile_data together for output on server exit.Is this possible? If so, it would be great if the wiki page was updated.
Many thanks
The text was updated successfully, but these errors were encountered: