lib/riemann/babbler/plugin.rb in riemann-babbler-0.6.0 vs lib/riemann/babbler/plugin.rb in riemann-babbler-0.6.1
- old
+ new
@@ -52,11 +52,10 @@
event[:state] = state(event[:metric]) unless plugin.states.critical.nil?
end
event[:tags] = options.riemann.tags unless options.riemann.tags.nil?
event[:host] = hostname
logger.debug "Report status: #{event.inspect}"
- logger.error "Riemann: #{riemann.inspect}"
riemann << event
end
def report_with_diff(event)
current_metric = event[:metric]
@@ -80,10 +79,10 @@
# Переодически вызываемое действие
def tick
posted_array = collect
posted_array = posted_array.class == Array ? posted_array : [ posted_array ]
- posted_array.each { |event| report event }
+ posted_array.uniq.each { |event| report event }
end
# Plugin init
def init
end