<commit_before>module HerokuProcScaler
  class WebReporter

    @last_report_time = 0
    @connection = nil

    def initialize
      @connection = ActiveRecord::Base.connection
    end

    def current_queue_depth depth
      report_queue_depth depth if WebReporter.should_report? depth
    end 

    def report_queue_depth depth
      update_stats_record depth
    end
  
    def self.should_report? depth
      time_to_report = (depth <= HerokuProcScaler.configuration.web_low_load_queue_max ? web_report_frequency_low_load : web_report_frequency_high_load)
      Time.now.to_i - @@last_report_time >= time_to_report
    end<commit_msg>fixes<commit_after>module HerokuProcScaler
  class WebReporter

    @last_report_time = 0
    @connection = nil

    def initialize
      @connection = ActiveRecord::Base.connection
    end

    def current_queue_depth depth
      report_queue_depth depth if WebReporter.should_report? depth
    end 

    def report_queue_depth depth
      update_stats_record depth
    end
  
    def self.should_report? depth
      time_to_report = (depth <= HerokuProcScaler.configuration.web_low_load_queue_max ? HerokuProcScaler.configuration.web_report_frequency_low_load : HerokuProcScaler.configuration.web_report_frequency_high_load)
      Time.now.to_i - @@last_report_time >= time_to_report
    end
{'fraction_non_alphanumeric': 0.05105105105105105, 'fraction_numerical': 0.0015015015015015015, 'mean_word_length': 3.812274368231047, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2634177', 'n_tokens_mistral': 412, 'n_tokens_neox': 397, 'n_words': 79}