<commit_before>#!/usr/bin/ruby

require 'socket'
HOSTNAME = `facter hostname`.chomp
SOCKET = UDPSocket.new

IO.popen(["curl","http://localhost:8000/haproxy;csv"]) do |haproxy_csv|
  header_line = haproxy_csv.gets
  header_line.gsub!(/# /,'')
  HEADERS = header_line.split(/,/)[0..-2]

  while line = haproxy_csv.gets do
    stats = Hash[HEADERS.zip($_.split(/,/))]
    HEADERS[2..-1].each do |statname|
      SOCKET.send("haproxy.#{HOSTNAME}.#{stats['pxname']}.#{stats['svname']}.#{statname}:#{stats[statname]}|g",0,'127.0.0.1',8125)
    end<commit_msg>Don't send so much haproxy data<commit_after>#!/usr/bin/ruby

require 'socket'
HOSTNAME = `facter hostname`.chomp
SOCKET = UDPSocket.new

IO.popen(["curl","http://localhost:8000/haproxy;csv"]) do |haproxy_csv|
  header_line = haproxy_csv.gets
  header_line.gsub!(/# /,'')
  HEADERS = header_line.split(/,/)[0..-2]

  while line = haproxy_csv.gets do
    stats = Hash[HEADERS.zip($_.split(/,/))]
    %w(scur smax ereq econ rate).each do |statname|
      SOCKET.send("haproxy.#{HOSTNAME}.#{stats['pxname']}.#{stats['svname']}.#{statname}:#{stats[statname]}|g",0,'127.0.0.1',8125)
    end
{'fraction_non_alphanumeric': 0.218804920913884, 'fraction_numerical': 0.03163444639718805, 'mean_word_length': 4.610837438423645, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4426635', 'n_tokens_mistral': 497, 'n_tokens_neox': 469, 'n_words': 62}