<commit_before>module Resque
  module Plugins
    module Statsd

      def after_enqueue_statsd(*args)
        StatsdHelper.statsd.increment("resque.#{@queue}.enqueued")
        StatsdHelper.statsd.increment("resque.total.enqueued")
      end

      def after_perform_statsd(*args)
        StatsdHelper.statsd.increment("resque.#{@queue}.finished")
        StatsdHelper.statsd.increment("resque.total.finished")
      end

      def on_failure_statsd(*args)
        StatsdHelper.statsd.increment("resque.#{@queue}.failed")
        StatsdHelper.statsd.increment("resque.total.failed")
      end

      def around_perform_statsd(*args)
        StatsdHelper.statsd.time("resque.#{@queue}.processed") do
          yield
        end
      end
    end
  end
end

<commit_msg>Logging split by job as well as queue in statsd<commit_after>module Resque
  module Plugins
    module Statsd

      def after_enqueue_statsd(*args)
        StatsdHelper.statsd.increment("resque.queues.#{@queue}.enqueued")
        StatsdHelper.statsd.increment("resque.jobs.#{self.name}.enqueued")
        StatsdHelper.statsd.increment("resque.total.enqueued")
      end

      def after_perform_statsd(*args)
        StatsdHelper.statsd.increment("resque.queues.#{@queue}.finished")
        StatsdHelper.statsd.increment("resque.jobs.#{self.name}.finished")
        StatsdHelper.statsd.increment("resque.total.finished")
      end

      def on_failure_statsd(*args)
        StatsdHelper.statsd.increment("resque.queues.#{@queue}.failed")
        StatsdHelper.statsd.increment("resque.jobs.#{self.name}.failed")
        StatsdHelper.statsd.increment("resque.total.failed")
      end

      def around_perform_statsd(*args)
        StatsdHelper.statsd.time("resque.queues.#{@queue}.processed") do
          StatsdHelper.statsd.time("resque.jobs.#{self.name}.processed") do
            yield
          end
        end
      end
    end
  end
end


{'fraction_non_alphanumeric': 0.12010443864229765, 'fraction_numerical': 0.0, 'mean_word_length': 2.94238683127572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '638176', 'n_tokens_mistral': 646, 'n_tokens_neox': 621, 'n_words': 77}