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 +4 -4
- data/CHANGELOG.md +5 -0
- data/CONTRIBUTION.md +1 -1
- data/Gemfile +4 -0
- data/README.md +1 -2
- data/lib/newrelic-rake/instrument.rb +6 -1
- data/lib/newrelic-rake/version.rb +1 -1
- data/test/newrelic_rake_test.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8c474b000081b3d427f233c6b2ef832e0b23d02
|
4
|
+
data.tar.gz: c529977f72d8db5b77e74ed00be0c936050d2675
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03a8a3c15d8b8cca7b47a49d98fd04c91ba230f032e4f705a049ed643edc78291f93f6aa080fdc6ad27e7d87a6f5c3e10aabada1fa9e5d650fe75ca0724e14fe
|
7
|
+
data.tar.gz: fd3033c5b776eb6f8802c615d662cad5d841adfc9495afb7a0e2fedec775f52d219c00e3230a2eb4176f4ae816a3ea235686caebc8f75283a00b4a4794d334c1
|
data/CHANGELOG.md
CHANGED
data/CONTRIBUTION.md
CHANGED
data/Gemfile
CHANGED
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) -
|
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
|
data/test/newrelic_rake_test.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require 'test/unit'
|
2
|
+
require 'mocha/setup'
|
2
3
|
require 'newrelic-rake/instrument'
|
3
4
|
|
4
|
-
class
|
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.
|
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-
|
11
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: newrelic_rpm
|