Skip to content

Instantly share code, notes, and snippets.

@Koronen
Last active August 29, 2015 13:57
Show Gist options
  • Save Koronen/9738152 to your computer and use it in GitHub Desktop.
Save Koronen/9738152 to your computer and use it in GitHub Desktop.
Resque statistics hacks
failures_with_ids = Resque::Failure.all(0,13000).each_with_index.map { |ex, i| ex['id'] = i; ex }
failure_grouped_by_exception = failures_with_ids.reduce({}){|acc, ex| acc[ex['exception']] ||= []; acc[ex['exception']] << ex; acc }
failure_grouped_by_class = failures_with_ids.reduce({}){|acc, ex| acc[ex['payload']['class']] ||= []; acc[ex['payload']['class']] << ex; acc }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment