Skip to content

Commit

Permalink
Merge pull request #324 from adamors/refactor-old-newrelic-api
Browse files Browse the repository at this point in the history
Refactor New Relic usage
  • Loading branch information
michaelklishin authored Nov 2, 2017
2 parents 53549d2 + 8d1bab1 commit 5043c16
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/sneakers/metrics/newrelic_metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def increment(metric)
end

def record_stat(metric, num)
stats(metric).record_data_point(num)
metric_name = "Custom/#{metric.gsub("\.", "\/")}"
NewrelicMetrics.eagent::Agent.record_metric(metric_name, num)
rescue Exception => e
puts "NewrelicMetrics#record_stat: #{e}"
end
Expand All @@ -25,12 +26,6 @@ def timing(metric, &block)
block.call
record_stat(metric, ((Time.now - start)*1000).floor)
end

def stats(metric)
metric.gsub! "\.", "\/"
NewrelicMetrics.eagent::Agent.get_stats("Custom/#{metric}")
end

end
end
end
Expand Down

0 comments on commit 5043c16

Please sign in to comment.