Module: Sidekiq::Throttled::Web

Defined in:
lib/sidekiq/throttled/web.rb,
lib/sidekiq/throttled/web/stats.rb

Overview

Provides Sidekiq tab to monitor and reset throttled stats.

Defined Under Namespace

Classes: Stats

Constant Summary collapse

VIEWS =
Pathname.new(__dir__).join("web")
THROTTLED_TPL =
VIEWS.join("throttled.html.erb").read.freeze
QUEUES_TPL =
VIEWS.join("queues.html.erb").read.freeze

Class Method Summary collapse

Class Method Details

.enhance_queues_tab!Object

Replace default Queues tab with enhanced one.



24
25
26
27
# File 'lib/sidekiq/throttled/web.rb', line 24

def enhance_queues_tab!
  Sidekiq::Web::DEFAULT_TABS["Queues"] = "enhanced-queues"
  Sidekiq::Web.tabs.delete("Enhanced Queues")
end

.registered(app) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



39
40
41
42
# File 'lib/sidekiq/throttled/web.rb', line 39

def registered(app)
  register_throttled_tab app
  register_enhanced_queues_tab app
end

.restore_queues_tab!Object

Restore original Queues tab.



33
34
35
36
# File 'lib/sidekiq/throttled/web.rb', line 33

def restore_queues_tab!
  Sidekiq::Web::DEFAULT_TABS["Queues"] = "queues"
  Sidekiq::Web.tabs["Enhanced Queues"] = "enhanced-queues"
end