Class: Rails::Service::StatusController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Rails::Service::StatusController
- Defined in:
- app/controller/rails/service/status_controller.rb
Overview
rubocop:disable Style/ClassAndModuleChildren
Constant Summary collapse
- SELECT_ONE =
'SELECT 1'.freeze
Instance Method Summary collapse
Instance Method Details
#db ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/controller/rails/service/status_controller.rb', line 16 def db time = Benchmark.realtime { ActiveRecord::Base.connection.execute(SELECT_ONE).first } render_status :ok, time: (time * 1_000).round(4) rescue => ex render_status :critical, exception: ex., class: ex.class.to_s end |
#index ⇒ Object
10 11 12 |
# File 'app/controller/rails/service/status_controller.rb', line 10 def index render_status :ok, time: Time.current end |