lib/logstash/outputs/scalyr.rb
# Return true if "send_status()" should be called even for an empty batch.
# NOTE: We always report status even if record count is 0 if more than X minutes have passed
# from the last status reporting for active plugins. Logstash sends empty batches for flush
# purposes quite often, but we only want to report status if we haven't reported it for a
# longer period (aka there hasn't been any data flowing in for a while). If we reported it
# for every flush event (which happens very often), this would skew metrics for regular
# events and output plugins which receive no data at all.
# We perform check against total events processed so we don't send status for output plugins
# which receive no data at all.
Return true if "send_status()" should be called even for an empty batch.
NOTE: We always report status even if record count is 0 if more than X minutes have passed
from the last status reporting for active plugins. Logstash sends empty batches for flush
purposes quite often, but we only want to report status if we haven't reported it for a
longer period (aka there hasn't been any data flowing in for a while). If we reported it
for every flush event (which happens very often), this would skew metrics for regular
events and output plugins which receive no data at all.
We perform check against total events processed so we don't send status for output plugins
which receive no data at all.
Return true if " send_status () " should be called even for an empty batch . NOTE : We always report status even if record count is 0 if more than X minutes have passed from the last status reporting for active plugins . Logstash sends empty batches for flush purposes quite often but we only want to report status if we haven ' t reported it for a longer period ( aka there hasn ' t been any data flowing in for a while ) . If we reported it for every flush event ( which happens very often ) this would skew metrics for regular events and output plugins which receive no data at all . We perform check against total events processed so we don ' t send status for output plugins which receive no data at all .
def should_call_send_status_for_empty_batch()
    if @multi_receive_statistics[:total_events_processed] < 100
      return false
    end
    if @last_status_transmit_time.nil?
      return false
    end
    return (Time.now.to_i - @last_status_transmit_time.to_i > @idle_status_report_deadline)
  end
def should_call_send_status_for_empty_batch ( ) if @multi_receive_statistics [ :total_events_processed ] < 100 return false end if @last_status_transmit_time . nil? return false end return ( Time . now . to_i - @last_status_transmit_time . to_i > @idle_status_report_deadline ) end
Return true if "send_status()" should be called even for an empty batch.
Return true if " send_status () " should be called even for an empty batch .
# Ignore idle plugins with no data # If this value is not set it means plugin is idle and hasn't received any data at all