- Documentação -> https://github.com/mperham/sidekiq/wiki/API
ps -ef | grep sidekiq | grep busy | grep -v grep | awk '{print $2}' > tmp/sidekiq.pid
cat tmp/sidekiq.pid
bundle exec sidekiqctl stop tmp/sidekiq.pid
ps -ef | grep sidekiq | grep busy | grep -v grep | awk '{print $2}'
kill -9 $(ps -ef | grep sidekiq | grep busy | grep -v grep | awk '{print $2}')
bundle exec sidekiq -d -L log/sidekiq.log -C config/sidekiq.yml
stats = Sidekiq::Stats.new
stats.processed
stats.failed
stats.scheduled_size
stats.retry_size
stats.dead_size
stats.processes_size
stats.default_queue_latency
stats.workers_size
stats.enqueued
queue_name = 'default'
Sidekiq::Queue.new(queue_name).map{|j| j.klass}.group_by{|e| e}.map{|k, v| [k, v.length]}.to_h
Sidekiq::RetrySet.new.map{|j| j.klass}.group_by{|e| e}.map{|k, v| [k, v.length]}.to_h
Sidekiq::DeadSet.new.map{|j| j.klass}.group_by{|e| e}.map{|k, v| [k, v.length]}.to_h
job_class_name = 'SidekiqTest::SidekiqTestWorker'
jobs = Sidekiq::RetrySet.new.select { |job| job.klass == job_class_name }; nil;
jobs.size
job_class_name = 'SidekiqTest::SidekiqTestWorker'
jobs = Sidekiq::DeadSet.new.select { |job| job.klass == job_class_name }; nil;
jobs.size
queue_name = 'default'
job_class_name = 'SidekiqTest::SidekiqTestWorker'
jobs = Sidekiq::Queue.new(queue_name).select {|job| job.klass == job_class_name };nil;
jobs.count
queue_name = 'default'
new_queue_name = 'funnels_test_worker'
queue = Sidekiq::Queue.new(queue_name)
queue.first(1000).each do |job|
if job.klass == "SidekiqTest::SidekiqTestWorker"
SidekiqTest::SidekiqTestWorker.set(queue: new_queue_name).perform_async(*job.args)
job.delete
end
end;nil
jobs.each(&:retry)
jobs.each(&:delete)
ps = Sidekiq::ProcessSet.new
ps.size
ps.each do |process|
p "pid: #{process['pid']} hostname: #{process['hostname']} busy: #{process['busy']} quiet: #{process['quiet']} queues: #{process['queues'].length} #{process['queues'].length} [#{process['queues'].sort.join(', ')}]"
end
ps = Sidekiq::ProcessSet.new
ps.each(&:quiet!)
ps = Sidekiq::ProcessSet.new
ps.each(&:stop!)
workers = Sidekiq::Workers.new
workers.size
workers.each do |process_id, thread_id, work|
p "process_id: #{process_id} thread_id: #{thread_id} queue: #{work['queue']} retry: #{work['payload']['retry']} class: #{work['payload']['class']}"
end
Sidekiq.redis { |conn| conn.flushdb }
http://localhost:3000/sidekiq/retries?count=100000
$('.container') .css({
'max-width': '100%',
'width': 'auto'
});
$('.table td') .css({
'overflow': 'auto'
})
$('.table td pre').css({
'overflow': 'auto',
'border': '1px solid black',
'margin': '10px 0'
});
$('.table th') .eq(1) .width('');
$('.table th') .eq(2) .width('');
$.getScript( "//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js" )
.done(function( script, textStatus ) {
$('table') .tablesorter();
});
// Usa o nome da fila funnels_test_worker
$("td:contains('funnels_test_worker')").parent().find('td input').prop('checked', true)
// Usa o erro ZeroDivisionError: divided by 0
$("td:contains('ZeroDivisionError: divided by 0')").parent().find('td input').prop('checked', true)