1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Remove sidekiqctl, add sidekiqmon

This commit is contained in:
Mike Perham 2019-08-02 11:07:06 -07:00
parent 4c93b99b62
commit 890dce58ec
4 changed files with 13 additions and 14 deletions

View file

@ -1,11 +0,0 @@
#!/usr/bin/env ruby
require 'fileutils'
require 'sidekiq/api'
require 'sidekiq/ctl'
if ARGV[0] == 'status'
Sidekiq::Ctl::Status.new.display(ARGV[1])
else
Sidekiq::Ctl.print_usage
end

9
bin/sidekiqmon Executable file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env ruby
require 'sidekiq/monitor'
if ARGV[0] == 'status'
Sidekiq::Monitor::Status.new.display(ARGV[1])
else
Sidekiq::Monitor.print_usage
end

View file

@ -3,19 +3,20 @@
require "fileutils"
require "sidekiq/api"
class Sidekiq::Ctl
class Sidekiq::Monitor
CMD = File.basename($PROGRAM_NAME)
attr_reader :stage
def self.print_usage
puts "#{CMD} - control Sidekiq from the command line."
puts "#{CMD} - monitor Sidekiq from the command line."
puts
puts "Usage: #{CMD} status <section>"
puts
puts " <section> (optional) view a specific section of the status output"
puts " Valid sections are: #{Sidekiq::Ctl::Status::VALID_SECTIONS.join(", ")}"
puts " Valid sections are: #{Sidekiq::Monitor::Status::VALID_SECTIONS.join(", ")}"
puts
puts "Set REDIS_URL to the location of your Redis server if not monitoring localhost."
end
class Status