Sha256: 393276add472ed2ebfb6f90718823d91c3be535cd33c07e7ebdd8366eca198a5

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

require 'kurchatov/riemann/client'

name 'riemann responder'
always_start true

default[:hosts] = Kurchatov::Config[:riemann_responder]

helpers do
  def flush
    @events_to_send ||= events.to_flush
    unless @events_to_send.empty?
      @riemanns.each { |riemann| riemann << @events_to_send }
      Log.debug("Sended events: #{@events_to_send}")
    end
    @events_to_send = nil
  end
end

run do
  @riemanns = []
  plugin.hosts.each do |host|
    riemann, port = host.split(':')
    @riemanns << Kurchatov::Riemann::Client.new(:host => riemann, :port => port)
  end
  loop { flush; sleep 0.5 }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kurchatov-0.0.8.pre.2 lib/kurchatov/responders/riemann.rb
kurchatov-0.0.8.pre.1 lib/kurchatov/responders/riemann.rb