<commit_before># frozen_string_literal: true

class IntervalSplitTraffic < ::ApplicationQuery
  attribute :start_time, :datetime
  attribute :end_time, :datetime
  attribute :total_in_count, :integer
  attribute :total_out_count, :integer
  attribute :total_finished_in_count, :integer
  attribute :total_finished_out_count, :integer
  attribute :event_ids, :integer_array_from_string
  attribute :short_names, :string_array_from_string
  attribute :in_counts, :integer_array_from_string
  attribute :out_counts, :integer_array_from_string
  attribute :finished_in_counts, :integer_array_from_string
  attribute :finished_out_counts, :integer_array_from_string

  Counts = Struct.new(:event_id, :name, :in, :out, :finished_in, :finished_out)
  ROW_LIMIT = 300

  def self.execute_query(event_group:, split_name:, band_width:)
    parameterized_split_name = split_name.parameterize
    band_width = band_width / 1.second
    split_times = ::SplitTime.joins(effort: :event).joins(:split).where(splits: {parameterized_base_name: parameterized_split_name}, events: {event_group: event_group})
    max = split_times.maximum(:absolute_time)
    min = split_times.minimum(:absolute_time)<commit_msg>Alphabetize some stuff<commit_after># frozen_string_literal: true

class IntervalSplitTraffic < ::ApplicationQuery
  attribute :end_time, :datetime
  attribute :event_ids, :integer_array_from_string
  attribute :finished_in_counts, :integer_array_from_string
  attribute :finished_out_counts, :integer_array_from_string
  attribute :in_counts, :integer_array_from_string
  attribute :out_counts, :integer_array_from_string
  attribute :short_names, :string_array_from_string
  attribute :start_time, :datetime
  attribute :total_finished_in_count, :integer
  attribute :total_finished_out_count, :integer
  attribute :total_in_count, :integer
  attribute :total_out_count, :integer

  Counts = Struct.new(:event_id, :name, :in, :out, :finished_in, :finished_out)
  ROW_LIMIT = 300

  def self.execute_query(event_group:, split_name:, band_width:)
    parameterized_split_name = split_name.parameterize
    band_width = band_width / 1.second
    split_times = ::SplitTime.joins(effort: :event).joins(:split).where(splits: {parameterized_base_name: parameterized_split_name}, events: {event_group: event_group})
    max = split_times.maximum(:absolute_time)
    min = split_times.minimum(:absolute_time)
{'fraction_non_alphanumeric': 0.08942749686585875, 'fraction_numerical': 0.003343083994985374, 'mean_word_length': 7.283737024221454, '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': '912751', 'n_tokens_mistral': 779, 'n_tokens_neox': 759, 'n_words': 145}