Class: NtqTools::Monitors::Sidekiq

Inherits:
Base
  • Object
show all
Defined in:
lib/ntq_tools/monitors/sidekiq.rb

Class Method Summary collapse

Class Method Details

.checkObject



16
17
18
19
20
21
22
23
24
# File 'lib/ntq_tools/monitors/sidekiq.rb', line 16

def check
  require 'sidekiq/api'
  ::Sidekiq::ProcessSet.new.any? { |process| process['busy'] }
rescue LoadError
  raise LoadError, <<-ERROR
    ::Sidekiq::ProcessSet could not be loaded by gem ntq_tools.
    It is required for Sidekiq monitoring'
  ERROR
end

.is_installed?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ntq_tools/monitors/sidekiq.rb', line 12

def is_installed?
  ::Gem.loaded_specs.has_key?('sidekiq')
end

.nameObject



8
9
10
# File 'lib/ntq_tools/monitors/sidekiq.rb', line 8

def name
  'sidekiq'
end