Skip to content

Commit

Permalink
RUBY-898 make sure unicorn warning is not too chatty
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarg committed Oct 23, 2012
1 parent 0858245 commit 4e7a635
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/new_relic/agent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -886,17 +886,16 @@ def harvest_timeslice_data(time=Time.now)

@unsent_timeslice_data ||= {}
@unsent_timeslice_data = @stats_engine.harvest_timeslice_data(@unsent_timeslice_data, @metric_ids)

warn_if_no_unicorn_metrics

warn_if_no_unicorn_metrics(@unsent_timeslice_data)
@unsent_timeslice_data
end

# this is just a support band-aid until we get a chance to
# overhaul the Unicorn instrumentation properly
def warn_if_no_unicorn_metrics
def warn_if_no_unicorn_metrics(metric_data)
if Agent.config[:dispatcher].to_s == 'unicorn'
if @stats_engine.get_stats_no_scope('HttpDispatcher').call_count == 0
spec = MetricSpec.new('HttpDispatcher')
if metric_data[spec].nil? || metric_data[spec].stats.call_count == 0
NewRelic::Control.instance.log.warn('Unicorn detected but no metric send, please see https://newrelic.com/docs/troubleshooting/im-using-unicorn-and-i-dont-see-any-data')
end
end
Expand Down

0 comments on commit 4e7a635

Please sign in to comment.