<commit_before>require 'travis/logs/helpers/metrics'
require 'travis/logs/helpers/s3'
require 'active_support/core_ext/object/try'
require 'uri'

module Travis
  module Logs
    module Services
      class ArchiveLog
        include Helpers::Metrics

        METRIKS_PREFIX = "logs.archive"

        def self.metriks_prefix
          METRIKS_PREFIX
        end

        class VerificationFailed < StandardError
          def initialize(log_id, target_url, expected, actual)
            super("Expected #{target_url} (from log id: #{log_id}) to have the content length #{expected.inspect}, but had #{actual.inspect}")
          end
        end

        attr_reader :log_id

        def initialize(log_id, storage_service=Helpers::S3.new, database=Travis::Logs.database_connection)
          @log_id = log_id<commit_msg>add a missing require activesupport ext<commit_after>require 'travis/logs/helpers/metrics'
require 'travis/logs/helpers/s3'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/numeric/time'
require 'uri'

module Travis
  module Logs
    module Services
      class ArchiveLog
        include Helpers::Metrics

        METRIKS_PREFIX = "logs.archive"

        def self.metriks_prefix
          METRIKS_PREFIX
        end

        class VerificationFailed < StandardError
          def initialize(log_id, target_url, expected, actual)
            super("Expected #{target_url} (from log id: #{log_id}) to have the content length #{expected.inspect}, but had #{actual.inspect}")
          end
        end

        attr_reader :log_id

        def initialize(log_id, storage_service=Helpers::S3.new, database=Travis::Logs.database_connection)
          @log_id = log_id
{'fraction_non_alphanumeric': 0.08484493856056173, 'fraction_numerical': 0.0023405500292568754, 'mean_word_length': 3.0046838407494145, 'pattern_counts': {'":': 0, '<': 5, '<?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': '658554', 'n_tokens_mistral': 505, 'n_tokens_neox': 501, 'n_words': 120}