<commit_before># frozen_string_literal: true

require 'singleton'

module RailsAutoscaleAgent
  class Config
    include Singleton

    attr_accessor :report_interval, :logger, :api_base_url, :max_request_size,
                  :dyno, :addon_name, :worker_adapters, :dev_mode, :debug, :quiet,
                  :track_long_running_jobs,

                  # legacy configs, no longer used
                  :sidekiq_latency_for_active_jobs, :latency_for_active_jobs

    def initialize
      require 'rails_autoscale_agent/worker_adapters/sidekiq'
      require 'rails_autoscale_agent/worker_adapters/sidekiq_active_jobs'
      require 'rails_autoscale_agent/worker_adapters/delayed_job'
      require 'rails_autoscale_agent/worker_adapters/delayed_job_active_jobs'
      require 'rails_autoscale_agent/worker_adapters/que'
      require 'rails_autoscale_agent/worker_adapters/resque'
      @worker_adapters = [
        WorkerAdapters::Sidekiq.instance,
        WorkerAdapters::SidekiqBusyJobs.instance,
        WorkerAdapters::DelayedJob.instance,
        WorkerAdapters::DelayedJobBusyJobs.instance,
        WorkerAdapters::Que.instance,
        WorkerAdapters::Resque.instance,
      ]

      # Allow the add-on name to be configured - needed for testing
      @addon_name = ENV['RAILS_AUTOSCALE_ADDON'] || 'RAILS_AUTOSCALE'
      @api_base_url = ENV["#{@addon_name}_URL"]
      @dev_mode = ENV['RAILS_AUTOSCALE_DEV'] == 'true'
      @debug = dev_mode? || ENV['RAILS_AUTOSCALE_DEBUG'] == 'true'
      @max_request_size = 100_000 # ignore request payloads over 100k since they skew the queue times
      @report_interval = 10 # this default will be overwritten during Reporter#register!
      @logger ||= defined?(Rails) ? Rails.logger : ::Logger.new(STDOUT)
      @dyno = dev_mode? ? 'dev.1' : ENV['DYNO']
    end
<commit_msg>Fix require paths<commit_after># frozen_string_literal: true

require 'singleton'

module RailsAutoscaleAgent
  class Config
    include Singleton

    attr_accessor :report_interval, :logger, :api_base_url, :max_request_size,
                  :dyno, :addon_name, :worker_adapters, :dev_mode, :debug, :quiet,
                  :track_long_running_jobs,

                  # legacy configs, no longer used
                  :sidekiq_latency_for_active_jobs, :latency_for_active_jobs

    def initialize
      require 'rails_autoscale_agent/worker_adapters/sidekiq'
      require 'rails_autoscale_agent/worker_adapters/sidekiq_busy_jobs'
      require 'rails_autoscale_agent/worker_adapters/delayed_job'
      require 'rails_autoscale_agent/worker_adapters/delayed_job_busy_jobs'
      require 'rails_autoscale_agent/worker_adapters/que'
      require 'rails_autoscale_agent/worker_adapters/resque'
      @worker_adapters = [
        WorkerAdapters::Sidekiq.instance,
        WorkerAdapters::SidekiqBusyJobs.instance,
        WorkerAdapters::DelayedJob.instance,
        WorkerAdapters::DelayedJobBusyJobs.instance,
        WorkerAdapters::Que.instance,
        WorkerAdapters::Resque.instance,
      ]

      # Allow the add-on name to be configured - needed for testing
      @addon_name = ENV['RAILS_AUTOSCALE_ADDON'] || 'RAILS_AUTOSCALE'
      @api_base_url = ENV["#{@addon_name}_URL"]
      @dev_mode = ENV['RAILS_AUTOSCALE_DEV'] == 'true'
      @debug = dev_mode? || ENV['RAILS_AUTOSCALE_DEBUG'] == 'true'
      @max_request_size = 100_000 # ignore request payloads over 100k since they skew the queue times
      @report_interval = 10 # this default will be overwritten during Reporter#register!
      @logger ||= defined?(Rails) ? Rails.logger : ::Logger.new(STDOUT)
      @dyno = dev_mode? ? 'dev.1' : ENV['DYNO']
    end

{'fraction_non_alphanumeric': 0.0912568306010929, 'fraction_numerical': 0.006557377049180328, 'mean_word_length': 3.5934755332496864, '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': '1062765', 'n_tokens_mistral': 1289, 'n_tokens_neox': 1188, 'n_words': 210}