Skip to content

Commit

Permalink
Test GC::Profiler
Browse files Browse the repository at this point in the history
  • Loading branch information
christinach committed Apr 22, 2024
1 parent d7ccd85 commit 4e16a41
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,12 +693,24 @@ class CatalogController < ApplicationController
def render_search_results_as_json
{ response: { docs: @document_list, facets: search_facets_as_json, pages: pagination_info(@response) } }
end

require 'rdoc/rdoc'
def index
if home_page?
render_empty_search
else
GC::Profiler.enable
gc_profiler_log = Logger.new('log/gc_profiler.log')

gc_profiler_log.info("--- before calling super ---")
GC::Profiler.report
gc_profiler_log.info(GC::Profiler.raw_data)
gc_profiler_log.info("--- before calling super ---")
super
gc_profiler_log.info("--- after calling super ---")
GC::Profiler.report
gc_profiler_log.info(GC::Profiler.raw_data)
gc_profiler_log.info("--- after calling super ---")
# GC::Profiler.disable
end
rescue ActionController::BadRequest
render file: Rails.public_path.join('x400.html'), layout: true, status: :bad_request
Expand Down

0 comments on commit 4e16a41

Please sign in to comment.