How do I reset my sidekiq counters?

Solution 1:

To reset statistics:

Sidekiq::Stats.new.reset

ref: Add reset stats to Web UI summary box and method to API

Also, you can now clear specific stats:

  • single stat by Sidekiq::Stats.new.reset('failed')
  • or multiple stats by Sidekiq::Stats.new.reset('failed', 'processed')

(Thanks https://stackoverflow.com/users/2475008/tmr08c for update)

Solution 2:

To reset processed jobs:

Sidekiq.redis {|c| c.del('stat:processed') }

and to reset failed jobs:

Sidekiq.redis {|c| c.del('stat:failed') }

Solution 3:

Also, to reset specific days in the history panel, you can do:

Sidekiq.redis {|c| c.del('stat:processed:2015-07-02') }
Sidekiq.redis {|c| c.del('stat:failed:2015-07-02') }

And repeat for each day you want to clear.

This is useful if you had a wild job spawning and failing many times more than your usual and you get a history graph with a massive spike in it that makes all your usual history values effectively a flat line.

Solution 4:

1. Clear retry set

Sidekiq::RetrySet.new.clear

2. Clear scheduled jobs

Sidekiq::ScheduledSet.new.clear

3. Clear 'Processed' and 'Failed' jobs

Sidekiq::Stats.new.reset

3. Clear 'Dead' jobs statistics

Sidekiq::DeadSet.new.clear

Font: https://gist.github.com/wbotelhos/fb865fba2b4f3518c8e533c7487d5354