2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-02-14 20:11:22 -06:00
|
|
|
# simple script to measure memory at boot
|
|
|
|
|
|
|
|
if ENV['RAILS_ENV'] != "production"
|
|
|
|
exec "RAILS_ENV=production ruby #{__FILE__}"
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'memory_profiler'
|
|
|
|
|
|
|
|
MemoryProfiler.report do
|
|
|
|
require File.expand_path("../../config/environment", __FILE__)
|
|
|
|
|
|
|
|
Rails.application.routes.recognize_path('abc') rescue nil
|
|
|
|
|
|
|
|
# load up the yaml for the localization bits, in master process
|
|
|
|
I18n.t(:posts)
|
|
|
|
|
|
|
|
# load up all models and schema
|
|
|
|
(ActiveRecord::Base.connection.tables - %w[schema_migrations versions]).each do |table|
|
|
|
|
table.classify.constantize.first rescue nil
|
|
|
|
end
|
|
|
|
end.pretty_print
|