Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add more New Relic instrumentation

  • Loading branch information...
commit a33216b417b77f4162a698647331cfdccf716634 1 parent 42c8fed
@rwdaigle authored
Showing with 10 additions and 0 deletions.
  1. +1 −0  Gemfile
  2. +5 −0 Gemfile.lock
  3. +4 −0 app/models/gist_fetcher.rb
View
1  Gemfile
@@ -20,6 +20,7 @@ gem 'will_paginate'
gem 'scrolls'
gem 'lograge'
gem 'newrelic_rpm'
+gem 'newrelic-faraday'
gem 'airbrake'
gem 'kanshi', :require => false
View
5 Gemfile.lock
@@ -80,6 +80,10 @@ GEM
mime-types (1.19)
multi_json (1.3.6)
multipart-post (1.1.5)
+ newrelic-faraday (0.6.3)
+ faraday (< 0.9)
+ faraday (>= 0.6)
+ newrelic_rpm (~> 3.0)
newrelic_rpm (3.4.2.1)
oauth2 (0.8.0)
faraday (~> 0.8)
@@ -180,6 +184,7 @@ DEPENDENCIES
kanshi
lograge
memcachier
+ newrelic-faraday
newrelic_rpm
octokit
omniauth
View
4 app/models/gist_fetcher.rb
@@ -2,6 +2,8 @@ class GistFetcher
class << self
+ include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
+
def fetch
period = ENV['FETCH_INTERVAL_MINS'] ? ENV['FETCH_INTERVAL_MINS'].to_i : 1440
since = period.minutes.ago
@@ -22,6 +24,8 @@ def fetch_user(user_id)
end
user.update_attribute(:last_gh_fetch, Time.now)
end
+
+ add_transaction_tracer :fetch_user, :category => :task, :params => '{ :user_id => args[0] }'
protected
Please sign in to comment.
Something went wrong with that request. Please try again.