class NewRelic::Agent::SyntheticsEventAggregator

Constants

TIMESTAMP

Public Instance Methods

record(event) click to toggle source
# File lib/new_relic/agent/synthetics_event_aggregator.rb, line 18
def record(event)
  return unless enabled?

  @lock.synchronize do
    @buffer.append(event: event, priority: -event[0][TIMESTAMP])
  end
end

Private Instance Methods

after_harvest(metadata) click to toggle source
# File lib/new_relic/agent/synthetics_event_aggregator.rb, line 28
def after_harvest(metadata)
  record_dropped_synthetics(metadata)
end
record_dropped_synthetics(metadata) click to toggle source
# File lib/new_relic/agent/synthetics_event_aggregator.rb, line 32
def record_dropped_synthetics(metadata)
  num_dropped = metadata[:seen] - metadata[:captured]
  return unless num_dropped > 0

  NewRelic::Agent.logger.debug("Synthetics transaction event limit (#{metadata[:capacity]}) reached. Further synthetics events this harvest period dropped.")

  engine = NewRelic::Agent.instance.stats_engine
  engine.tl_record_supportability_metric_count('SyntheticsEventAggregator/synthetics_events_dropped', num_dropped)
end