Sha256: 61012475b645b3e4f0af988b713d86e88252f1ea53910d2fc4ea8200929df375
Contents?: true
Size: 686 Bytes
Versions: 23
Compression:
Stored size: 686 Bytes
Contents
require 'socket' require 'timeout' require 'kurchatov/riemann/client' require 'yaml' require File.expand_path('../testreceived', __FILE__) PORT = 5555 HOST = '127.0.0.1' RECEIVE_INTERVAL = 60 server = TCPServer.new(HOST, PORT) events = [] puts "Run riemann server at #{HOST}:#{PORT}" Timeout::timeout(RECEIVE_INTERVAL) { client = server.accept loop do line = client.read(4) break if line.nil? || line.size != 4 length = line.unpack('N').first str = client.read(length) message = Kurchatov::Riemann::Message.decode(str) message.events.each do |event| events << event end end } t = TestReceived.new(events, './tests/data/event.yml') t.compare!
Version data entries
23 entries across 23 versions & 1 rubygems