Add some time measurement output

This commit is contained in:
Georg Gadinger 2017-03-31 22:38:23 +02:00
parent dcca449de1
commit ab536284f3
3 changed files with 7 additions and 0 deletions

View File

@ -4,7 +4,9 @@ require 'rails/all'
# Require the gems listed in Gemfile, including any gems # Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production. # you've limited to :test, :development, or :production.
start = Time.now
Bundler.require(*Rails.groups) Bundler.require(*Rails.groups)
puts 'processing time of bundler require: ' + "#{(Time.now - start).round(3).to_s.ljust(5, '0')}s".light_green
module Justask module Justask
class Application < Rails::Application class Application < Rails::Application

View File

@ -2,4 +2,6 @@
require File.expand_path('../application', __FILE__) require File.expand_path('../application', __FILE__)
# Initialize the Rails application. # Initialize the Rails application.
start = Time.now
Rails.application.initialize! Rails.application.initialize!
puts 'processing time of Rails.application.initialize!: ' + "#{(Time.now - start).round(3).to_s.ljust(5, '0')}s".light_green

View File

@ -1,5 +1,6 @@
require 'sidekiq/web' require 'sidekiq/web'
Rails.application.routes.draw do Rails.application.routes.draw do
start = Time.now
# Admin panel # Admin panel
mount RailsAdmin::Engine => '/justask_admin', as: 'rails_admin' mount RailsAdmin::Engine => '/justask_admin', as: 'rails_admin'
@ -125,4 +126,6 @@ Rails.application.routes.draw do
match '/:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends, defaults: {page: 1} match '/:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends, defaults: {page: 1}
match '/:username/groups(/p/:page)', to: 'user#groups', via: 'get', as: :show_user_groups, defaults: {page: 1} match '/:username/groups(/p/:page)', to: 'user#groups', via: 'get', as: :show_user_groups, defaults: {page: 1}
match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1} match '/:username/questions(/p/:page)', to: 'user#questions', via: 'get', as: :show_user_questions, defaults: {page: 1}
puts 'processing time of routes.rb: ' + "#{(Time.now - start).round(3).to_s.ljust(5, '0')}s".light_green
end end