Class: Profiler::ProfilesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Profiler::ProfilesController
- Defined in:
- app/controllers/profiler/profiles_controller.rb
Instance Method Summary collapse
- #cache ⇒ Object
- #database ⇒ Object
- #flamegraph ⇒ Object
- #index ⇒ Object
- #performance ⇒ Object
- #show ⇒ Object
- #timeline ⇒ Object
- #views ⇒ Object
Instance Method Details
#cache ⇒ Object
51 52 53 54 |
# File 'app/controllers/profiler/profiles_controller.rb', line 51 def cache @profile = Profiler.storage.load(params[:id]) render json: @profile.collector_data("cache") end |
#database ⇒ Object
41 42 43 44 |
# File 'app/controllers/profiler/profiles_controller.rb', line 41 def database @profile = Profiler.storage.load(params[:id]) render json: @profile.collector_data("database") end |
#flamegraph ⇒ Object
61 62 63 64 |
# File 'app/controllers/profiler/profiles_controller.rb', line 61 def flamegraph @profile = Profiler.storage.load(params[:id]) render json: @profile.collector_data("flamegraph") end |
#index ⇒ Object
7 8 9 10 11 12 13 |
# File 'app/controllers/profiler/profiles_controller.rb', line 7 def index limit = params[:limit]&.to_i || 50 offset = params[:offset]&.to_i || 0 @profiles = Profiler.storage.list(limit: limit, offset: offset) @profiles = filter_profiles(@profiles) if params[:filter].present? end |
#performance ⇒ Object
56 57 58 59 |
# File 'app/controllers/profiler/profiles_controller.rb', line 56 def performance @profile = Profiler.storage.load(params[:id]) render json: @profile.collector_data("performance") end |
#show ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/profiler/profiles_controller.rb', line 15 def show @profile = Profiler.storage.load(params[:id]) unless @profile render plain: "Profile not found", status: :not_found return end # Recalculate AJAX collector data (since AJAX requests happen after page load) recalculate_ajax_data(@profile) @profile_data = @profile.to_h.merge( child_jobs: build_child_jobs(@profile), parent_profile: build_parent_summary(@profile) ) @embedded = params[:embed] == "true" render layout: @embedded ? "profiler/embedded" : "profiler/application" end |