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

Version Path
kurchatov-0.4.7 tests/server.rb
kurchatov-0.4.6 tests/server.rb
kurchatov-0.4.5 tests/server.rb
kurchatov-0.4.4 tests/server.rb
kurchatov-0.4.3 tests/server.rb
kurchatov-0.4.2 tests/server.rb
kurchatov-0.4.1 tests/server.rb
kurchatov-0.3.8 tests/server.rb
kurchatov-0.3.7 tests/server.rb
kurchatov-0.3.6 tests/server.rb
kurchatov-0.3.5 tests/server.rb
kurchatov-0.3.4 tests/server.rb
kurchatov-0.3.3 tests/server.rb
kurchatov-0.3.2 tests/server.rb
kurchatov-0.3.1 tests/server.rb
kurchatov-0.3.0 tests/server.rb
kurchatov-0.2.9 tests/server.rb
kurchatov-0.2.8 tests/server.rb
kurchatov-0.2.7 tests/server.rb
kurchatov-0.2.6 tests/server.rb