newrelic-rake 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b0e5523a22c4d0af40b70de6f72abedc162c6e1
4
- data.tar.gz: ed92a2ca729b79911705d1e8790c03e7aaf56af4
3
+ metadata.gz: e8c474b000081b3d427f233c6b2ef832e0b23d02
4
+ data.tar.gz: c529977f72d8db5b77e74ed00be0c936050d2675
5
5
  SHA512:
6
- metadata.gz: 25f62b4e82aae4ba95b8d4961fe90b804cd08fba16d41bdc14e921f32363f68eeb31c4466885380a8b51c22ebb5da0a23c1c4d0c64a3c6eae89063ec1218946e
7
- data.tar.gz: 59b0222851379de5ae9d8a9b3682dd2e1dcd20ea9dfc4d444b85c78935bdeb2b8c18b7b1beaaad402a1c7dca026f4d8c6c03455b0296f018a099bc67193d7109
6
+ metadata.gz: 03a8a3c15d8b8cca7b47a49d98fd04c91ba230f032e4f705a049ed643edc78291f93f6aa080fdc6ad27e7d87a6f5c3e10aabada1fa9e5d650fe75ca0724e14fe
7
+ data.tar.gz: fd3033c5b776eb6f8802c615d662cad5d841adfc9495afb7a0e2fedec775f52d219c00e3230a2eb4176f4ae816a3ea235686caebc8f75283a00b4a4794d334c1
@@ -1,5 +1,10 @@
1
1
  # Next Release
2
2
 
3
+ ## 1.2.0 (03/19/2013)
4
+
5
+ * Force dispatcher to rake.
6
+ * Shutdown agent at exit.
7
+
3
8
  ## 1.1.0 (03/15/2013)
4
9
 
5
10
  * Make sure #method_tracer is there by the time we start tracking.
@@ -9,4 +9,4 @@ We love pull requests. Here's a quick guide:
9
9
  5. Create new Pull Request
10
10
 
11
11
  Please make sure you add a test for your change and all tests are passed.
12
- (`bundle && rspec spec`)
12
+ (`bundle && rake test`)
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in newrelic-rake.gemspec
4
4
  gemspec
5
+
6
+ group :development do
7
+ gem 'mocha', '~> 0.13.3'
8
+ end
data/README.md CHANGED
@@ -23,8 +23,7 @@ nothing special to set.
23
23
  ## Authors and Contributors
24
24
 
25
25
  * [Richard Huang](https://github.com/flyerhzm) - Creator of the project
26
- * [Yury Velikanau](yury.velikanau@gmail.com) - Add tests, fix newrelic
27
- method tracer.
26
+ * [Yury Velikanau](yury.velikanau@gmail.com) - Main contributor
28
27
 
29
28
  Please fork and contribute, any help in making this project better is appreciated!
30
29
 
@@ -17,11 +17,16 @@ DependencyDetection.defer do
17
17
 
18
18
  alias_method :origin_execute, :execute
19
19
  def execute(args=nil)
20
- NewRelic::Agent.manual_start
20
+ NewRelic::Agent.manual_start(:dispatcher => :rake)
21
21
  perform_action_with_newrelic_trace(:name => self.name, :category => "OtherTransaction/Rake") do
22
22
  origin_execute(args)
23
23
  end
24
24
  end
25
+
26
+ # Make sure NewRelic agent flush data to the server according to
27
+ # https://newrelic.com/docs/ruby/monitoring-ruby-background-processes-and-daemons
28
+ # even though Agent configuration is :send_data_on_exit => true
29
+ at_exit { NewRelic::Agent.shutdown }
25
30
  end
26
31
  end
27
32
  end
@@ -1,5 +1,5 @@
1
1
  module Newrelic
2
2
  module Rake
3
- VERSION = "1.1.0"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
1
  require 'test/unit'
2
+ require 'mocha/setup'
2
3
  require 'newrelic-rake/instrument'
3
4
 
4
- class TestNewRelicRedis < Test::Unit::TestCase
5
+ class TestNewRelicRake < Test::Unit::TestCase
5
6
  include NewRelic::Agent::Instrumentation::ControllerInstrumentation
6
7
 
7
8
  def setup
@@ -23,4 +24,10 @@ class TestNewRelicRedis < Test::Unit::TestCase
23
24
  Rake::Task['foo'].invoke
24
25
  assert @engine.metrics.include?('OtherTransaction/Rake/Rake::Task/foo'), 'rake task is not in metrics'
25
26
  end
27
+
28
+ def test_dispatcher
29
+ NewRelic::Agent.expects(:manual_start).with(:dispatcher => :rake)
30
+ Rake::Task.define_task('bar')
31
+ Rake::Task['bar'].invoke
32
+ end
26
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-15 00:00:00.000000000 Z
11
+ date: 2013-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: newrelic_rpm