<commit_before>#########################################################
# <NAME> : <EMAIL>
# Mobile Devices 2014
#########################################################

module RUBY_AGENT_STATS


  def self.init(agent_name, type, run_id, version, static_infos)
    @stats_mutex ||= Mutex.new
    RUBY_AGENT_STATS.reset_stats
    @ruby_agent_stats['name'] = agent_name
    @ruby_agent_stats['type'] = type
    @ruby_agent_stats['start_time'] = Time.now
    @ruby_agent_stats['run_id'] = run_id
    @ruby_agent_stats['version'] = version
    @ruby_agent_stats['static_infos'] = static_infos
  end

  def self.flush_to_file(additional_specific_infos)

    @stats_mutex.synchronize do

      @ruby_agent_stats['additional_specific_infos'] = additional_specific_infos
      @ruby_agent_stats['uptime'] = (Time.now - @ruby_agent_stats['start_time']).to_i<commit_msg>Fix time uptime.<commit_after>#########################################################
# <NAME> : <EMAIL>
# Mobile Devices 2014
#########################################################

module RUBY_AGENT_STATS


  def self.init(agent_name, type, run_id, version, static_infos)
    @stats_mutex ||= Mutex.new
    RUBY_AGENT_STATS.reset_stats
    @ruby_agent_stats['name'] = agent_name
    @ruby_agent_stats['type'] = type
    @ruby_agent_stats['start_time'] = Time.now.to_i
    @ruby_agent_stats['start_time_date'] = Time.now
    @ruby_agent_stats['run_id'] = run_id
    @ruby_agent_stats['version'] = version
    @ruby_agent_stats['static_infos'] = static_infos
  end

  def self.flush_to_file(additional_specific_infos)

    @stats_mutex.synchronize do

      @ruby_agent_stats['uptime'] = (Time.now - @ruby_agent_stats['start_time_date']).to_i
{'fraction_non_alphanumeric': 0.23684210526315788, 'fraction_numerical': 0.004678362573099415, 'mean_word_length': 5.955284552845528, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3078496', 'n_tokens_mistral': 606, 'n_tokens_neox': 555, 'n_words': 79}