<commit_before>module Resque
  module Plugins
    module Telework
      module JobStats
        
        include Resque::Plugins::Telework::Redis

        def before_perform_stats(*args)
          unless @host
            @host= ENV['TELEWORK_HOSTNAME']
            unless @host
              require 'socket'
              @host= Socket::gethostname()
            end
          end
          puts "before_perform_stats()"
          puts "host is #{@host}"
          stats_inc( @host, @queue, 'started' )
        end

        def after_perform_stats(*args)
          puts "after_perform_stats()"
          puts "host is #{@host}"        	
          stats_inc( @host, @queue, 'ended' )	
        end

        def on_failure_stats(e, *args)
          puts "on_failure_stats()"
          puts "host is #{@host}"        	
          stats_inc( @host, @queue, 'failed' )
          raise e
        end

      end
    end
  end
end<commit_msg>Do not rethrow, print exception for debugging<commit_after>module Resque
  module Plugins
    module Telework
      module JobStats
        
        include Resque::Plugins::Telework::Redis

        def before_perform_stats(*args)
          unless @host
            @host= ENV['TELEWORK_HOSTNAME']
            unless @host
              require 'socket'
              @host= Socket::gethostname()
            end
          end
          puts "before_perform_stats()"
          puts "host is #{@host}"
          stats_inc( @host, @queue, 'started' )
        end

        def after_perform_stats(*args)
          puts "after_perform_stats()"
          puts "host is #{@host}"        	
          stats_inc( @host, @queue, 'ended' )	
        end

        def on_failure_stats(e, *args)
          puts "on_failure_stats()"
          puts "Exception #{e}"
          puts "host is #{@host}"        	
          stats_inc( @host, @queue, 'failed' )
        end

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0961337513061651, 'fraction_numerical': 0.0, 'mean_word_length': 1.587837837837838, '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': '5739111', 'n_tokens_mistral': 556, 'n_tokens_neox': 555, 'n_words': 142}