Class: RubyLLM::Resilience::BreakersController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/ruby_llm/resilience/breakers_controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.controller_pathObject

ruby_llm's Railtie registers acronym "RubyLLM", which changes this controller's DERIVED controller_path to "rubyllm/resilience/breakers" in host apps — breaking template lookup (views ship under app/views/ruby_llm/...). Pin the path so lookup is deterministic regardless of the host's inflections.



11
12
13
# File 'app/controllers/ruby_llm/resilience/breakers_controller.rb', line 11

def self.controller_path
  "ruby_llm/resilience/breakers"
end

Instance Method Details

#indexObject



22
23
24
25
26
27
28
# File 'app/controllers/ruby_llm/resilience/breakers_controller.rb', line 22

def index
  services = params[:services].presence&.split(",") ||
             Resilience.config.dashboard_services
  @statuses = Breaker.dashboard_status(services: services)
  @fallback_routes = Resilience.fallback_routes
  @config = Resilience.config
end

#resetObject



37
38
39
40
# File 'app/controllers/ruby_llm/resilience/breakers_controller.rb', line 37

def reset
  Breaker.new(params[:id]).reset!
  redirect_to root_path, notice: "Reset #{params[:id]}"
end