Module: Sidekiq::Throttled::Web

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

Overview

Provides Sidekiq tab to monitor and reset throttled stats.

Defined Under Namespace

Modules: SummaryFix 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.


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

def enhance_queues_tab!
  SummaryFix.enabled = true
  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.


42
43
44
45
46
# File 'lib/sidekiq/throttled/web.rb', line 42

def registered(app)
  SummaryFix.apply! app
  register_throttled_tab app
  register_enhanced_queues_tab app
end

.restore_queues_tab!Object

Restore original Queues tab.


35
36
37
38
39
# File 'lib/sidekiq/throttled/web.rb', line 35

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