<commit_before># Sigh network collector collecting Linux interface input traffic

Sigh::Collector.collects do
  type 'network'
  name 'eth0_in'
  unit 'kB/s'
  upper_bound 0.0 # Doesn't really make sense on a network interface

  measure do
    first, second = nil, nil

    2.times do
      File.read('/proc/net/dev').each_lines do |line|
        line.strip!
        if line.start_with? 'eth0'
          unless first
            first = line.split[0].split(':')[1].to_f
            sleep 1
          else
            second = line.split[0].split(':')[1].to_f
          end
        end
      end
    end

    (second - first) / 1024.0
  end
end<commit_msg>What did I say about checking things...<commit_after># Sigh network collector collecting Linux interface input traffic

Sigh::Collector.collects do
  type 'network'
  name 'eth0_in'
  unit 'kB/s'
  upper_bound 0.0 # Doesn't really make sense on a network interface

  measure do
    first, second = nil, nil

    2.times do
      File.read('/proc/net/dev').each_line do |line|
        line.strip!
        if line.start_with? 'eth0'
          unless first
            first = line.split[0].split(':')[1].to_f
            sleep 1
          else
            second = line.split[0].split(':')[1].to_f
          end
        end
      end
    end

    (second - first) / 1024.0
  end
end
{'fraction_non_alphanumeric': 0.10545998504113688, 'fraction_numerical': 0.02243829468960359, 'mean_word_length': 1.9866071428571428, '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': '3616060', 'n_tokens_mistral': 446, 'n_tokens_neox': 419, 'n_words': 125}