Skip to content

Instantly share code, notes, and snippets.

@pvgomes
Created April 17, 2020 17:51
Show Gist options
  • Save pvgomes/ad068085489de446a1cb0b068d7dbc6f to your computer and use it in GitHub Desktop.
Save pvgomes/ad068085489de446a1cb0b068d7dbc6f to your computer and use it in GitHub Desktop.
an example to reset sidekiq counter
require 'sidekiq/api'
Sidekiq.redis {|c| c.del('stat:processed') }
Sidekiq.redis {|c| c.del('stat:failed') }
# Sidekiq.redis { |r| r.lrange "queue:app_queue", 0, -1 }
#
# # Count messages in queue
# # default_queue = Sidekiq::Queue.new
# # default_queue.size
#
#
# # stats = Sidekiq::Stats.new
# # Get the number of jobs that have been processed.
# # stats.processed
# # Get the number of jobs that have failed.
# # stats.failed
# # Get the queues with name and number enqueued.
# #stats.queues # => { "default" => 1001, "email" => 50 }
#
# #Gets the number of jobs enqueued in all queues (does NOT include retries and scheduled jobs).
# #stats.enqueued # => 1051
#
# #Get retry size
# #stats.retry_size
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment