<commit_before>require "socket"

module ExceptionHandling
  class Sensu
    class << self
      def generate_event(name, message, level = :warning)
        status = case level
                   when :warning
                     1
                   when :critical
                     2
                   else
                     raise "Invalid alert level #{level.to_s}"
                 end

        event = {name: "#{ExceptionHandling.sensu_prefix}#{name}", output: message, status: status}

        send_event(event)
      end<commit_msg>TECH-650: Convert sensu class to be module since it has no instance methods<commit_after>require "socket"

module ExceptionHandling
  module Sensu
    class << self
      def generate_event(name, message, level = :warning)
        status = case level
                   when :warning
                     1
                   when :critical
                     2
                   else
                     raise "Invalid alert level #{level.to_s}"
                 end

        event = {name: "#{ExceptionHandling.sensu_prefix}#{name}", output: message, status: status}

        send_event(event)
      end
{'fraction_non_alphanumeric': 0.07272727272727272, 'fraction_numerical': 0.006060606060606061, 'mean_word_length': 1.4913793103448276, 'pattern_counts': {'":': 0, '<': 7, '<?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': '644602', 'n_tokens_mistral': 294, 'n_tokens_neox': 273, 'n_words': 87}