rpm_contrib 2.1.6 → 2.1.7
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.
- data/CHANGELOG +13 -1
- data/README.md +8 -1
- data/lib/rpm_contrib/instrumentation/active_messaging.rb +6 -8
- data/lib/rpm_contrib/instrumentation/picky.rb +41 -0
- data/lib/rpm_contrib/instrumentation/resque.rb +3 -0
- data/lib/rpm_contrib/instrumentation/thinking_sphinx.rb +1 -0
- data/lib/rpm_contrib/language_support.rb +4 -1
- data/test/test_picky.rb +55 -0
- metadata +66 -42
data/CHANGELOG
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
+
* Version 2.1.7
|
2
|
+
|
3
|
+
Community contributed instrumentation
|
4
|
+
- ThinkingSphinx instrumentation improvement (Martin Sarsale)
|
5
|
+
- Picky search engine instrumentation (Niko Dittmann)
|
6
|
+
Community Contributed Bug Fixes
|
7
|
+
- Fix instrumentation injection for ActiveMessaging (W. Andrew Loe III)
|
8
|
+
Other
|
9
|
+
- Improvements to resque instrumentation detection of if its in a forking ruby implementation
|
10
|
+
|
1
11
|
* Version 2.1.6
|
12
|
+
|
2
13
|
Community contributed instrumentation
|
3
14
|
- ThinkingSphinx instrumentation (W. Andrew Loe III)
|
4
15
|
- Riak instrumentation (Bryce Kerley)
|
@@ -6,7 +17,8 @@
|
|
6
17
|
Community Contributed Bug Fixes
|
7
18
|
- MongoDB instrumentation (Kenn Ejima)
|
8
19
|
- Yajl instrumentation (Chris Griego)
|
9
|
-
|
20
|
+
- UltraSphinx instrumentation (Jonathan Rudenberg)
|
21
|
+
- Renamed ActiveMQ instrumentation to ActiveMessaging (W. Andrew Loe III)
|
10
22
|
|
11
23
|
* Version 2.1.5
|
12
24
|
|
data/README.md
CHANGED
@@ -100,6 +100,12 @@ No special configuration required for Paperclip visibility.
|
|
100
100
|
|
101
101
|
You can disable it by setting `disable_paperclip` to true in your newrelic.yml file.
|
102
102
|
|
103
|
+
### Picky
|
104
|
+
|
105
|
+
The gem will instrument the [Picky semantic search engine](http://florianhanke.com/picky/) so it should be visible in transaction traces and the web transactions page.
|
106
|
+
|
107
|
+
You can disable it with `disable_picky` in your newrelic.yml file.
|
108
|
+
|
103
109
|
### MongoDB
|
104
110
|
|
105
111
|
Our instrumentation works on the underlying 'Mongo' library.
|
@@ -266,7 +272,8 @@ we'll be happy to help you work through it.
|
|
266
272
|
files will be loaded when the RPM agent is initialized.
|
267
273
|
* Add samplers to `lib/rpm_contrib/samplers`. These classes are
|
268
274
|
installed automatically when the RPM agent is initialized.
|
269
|
-
* Add tests.
|
275
|
+
* Add tests.
|
276
|
+
* Update README.md
|
270
277
|
* Commit, do not mess with the Rakefile, version, or history. (if you
|
271
278
|
want to have your own version, that is fine but bump version in a
|
272
279
|
commit by itself I can ignore when I pull)
|
@@ -1,24 +1,22 @@
|
|
1
|
-
#
|
2
|
-
# Robert R. Meyer
|
3
|
-
# Blue-Dog-Archolite @ GitHub
|
1
|
+
# ActiveMessaging Instrumentation
|
4
2
|
|
5
3
|
DependencyDetection.defer do
|
6
4
|
@name = :active_messaging
|
7
|
-
|
5
|
+
|
8
6
|
depends_on do
|
9
7
|
defined?(::ActiveMessaging::Processor) && !NewRelic::Control.instance['disable_active_messaging'] &&
|
10
8
|
!NewRelic::Control.instance['disable_active_mq']
|
11
9
|
end
|
12
|
-
|
10
|
+
|
13
11
|
executes do
|
14
12
|
NewRelic::Agent.logger.debug 'Installing ActiveMessaging instrumentation'
|
15
13
|
end
|
16
14
|
|
17
15
|
executes do
|
18
16
|
::ActiveMessaging::Processor.class_eval do
|
19
|
-
|
20
|
-
|
21
|
-
|
17
|
+
include NewRelic::Agent::MethodTracer
|
18
|
+
|
19
|
+
add_method_tracer :on_message, 'ActiveMessaging/OnMessage'
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
if defined?(::Picky)
|
2
|
+
|
3
|
+
class Picky::NewRelic
|
4
|
+
def self.obfuscate_tokens tokens
|
5
|
+
tokens.map { |t|
|
6
|
+
o = 'xxx'
|
7
|
+
o += '~' if t.similar?
|
8
|
+
o += '*' if t.partial?
|
9
|
+
o = t.qualifiers.sort.join(',') + ':' + o if t.qualifiers && t.qualifiers.respond_to?(:join)
|
10
|
+
o
|
11
|
+
}.sort.join(' ')
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
DependencyDetection.defer do
|
18
|
+
@name = :picky
|
19
|
+
|
20
|
+
depends_on do
|
21
|
+
defined?(::Picky::Search) && !NewRelic::Control.instance['disable_picky']
|
22
|
+
end
|
23
|
+
|
24
|
+
executes do
|
25
|
+
NewRelic::Agent.logger.debug 'Installing Picky instrumentation'
|
26
|
+
end
|
27
|
+
|
28
|
+
executes do
|
29
|
+
::Picky::Search.class_eval do
|
30
|
+
include NewRelic::Agent::MethodTracer
|
31
|
+
|
32
|
+
def execute_with_newrelic_trace *args
|
33
|
+
metrics = "Custom/Picky/search: #{Picky::NewRelic.obfuscate_tokens args[0]}"
|
34
|
+
self.class.trace_execution_scoped(metrics){ execute_without_newrelic_trace(*args) }
|
35
|
+
end
|
36
|
+
|
37
|
+
alias_method :execute_without_newrelic_trace, :execute
|
38
|
+
alias_method :execute, :execute_with_newrelic_trace
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -20,7 +20,10 @@ module RPMContrib::LanguageSupport
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def test_forkability
|
23
|
-
Process.fork { exit! }
|
23
|
+
child = Process.fork { exit! }
|
24
|
+
# calling wait here doesn't seem like it should necessary, but it seems to
|
25
|
+
# resolve some weird edge cases with resque forking.
|
26
|
+
Process.wait child
|
24
27
|
true
|
25
28
|
rescue NotImplementedError
|
26
29
|
false
|
data/test/test_picky.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'picky'
|
2
|
+
|
3
|
+
require "#{File.dirname(__FILE__)}/helper"
|
4
|
+
|
5
|
+
class NewRelic::Agent::PickyIntrumentationTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def tokens_for *tokens
|
8
|
+
tokens.map{|t|
|
9
|
+
token = 'whatever'
|
10
|
+
|
11
|
+
token.extend Module.new{
|
12
|
+
define_method(:'partial?'){ t[:partial] }
|
13
|
+
define_method(:'similar?'){ t[:similar] }
|
14
|
+
define_method(:'qualifiers'){ t[:qualifiers] }
|
15
|
+
}
|
16
|
+
|
17
|
+
token
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_obfuscate_tokens
|
22
|
+
tokens = tokens_for({})
|
23
|
+
assert_equal 'xxx', Picky::NewRelic.obfuscate_tokens(tokens)
|
24
|
+
|
25
|
+
tokens = tokens_for({:similar => true})
|
26
|
+
assert_equal 'xxx~', Picky::NewRelic.obfuscate_tokens(tokens)
|
27
|
+
|
28
|
+
tokens = tokens_for({:partial => true})
|
29
|
+
assert_equal 'xxx*', Picky::NewRelic.obfuscate_tokens(tokens)
|
30
|
+
|
31
|
+
tokens = tokens_for({:qualifiers => [:haha]})
|
32
|
+
assert_equal 'haha:xxx', Picky::NewRelic.obfuscate_tokens(tokens)
|
33
|
+
|
34
|
+
tokens = tokens_for( {:partial => true}, {:similar => true} )
|
35
|
+
assert_equal 'xxx* xxx~', Picky::NewRelic.obfuscate_tokens(tokens)
|
36
|
+
|
37
|
+
tokens = tokens_for( {:similar => true}, {:partial => true} )
|
38
|
+
assert_equal 'xxx* xxx~', Picky::NewRelic.obfuscate_tokens(tokens)
|
39
|
+
|
40
|
+
tokens = tokens_for( {:partial => true}, {:partial => true} )
|
41
|
+
assert_equal 'xxx* xxx*', Picky::NewRelic.obfuscate_tokens(tokens)
|
42
|
+
|
43
|
+
tokens = tokens_for(
|
44
|
+
{:similar => true, :qualifiers => [:bla]},
|
45
|
+
{:partial => true, :qualifiers => [:bla, :blub]}
|
46
|
+
)
|
47
|
+
assert_equal 'bla,blub:xxx* bla:xxx~', Picky::NewRelic.obfuscate_tokens(tokens)
|
48
|
+
|
49
|
+
tokens = tokens_for(
|
50
|
+
{:similar => true, :qualifiers => [:bla]},
|
51
|
+
{:partial => true, :qualifiers => [:blub, :bla]}
|
52
|
+
)
|
53
|
+
assert_equal 'bla,blub:xxx* bla:xxx~', Picky::NewRelic.obfuscate_tokens(tokens)
|
54
|
+
end
|
55
|
+
end
|
metadata
CHANGED
@@ -1,53 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rpm_contrib
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
- 7
|
10
|
+
version: 2.1.7
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Bill Kayser
|
9
14
|
- Jon Guymon
|
10
15
|
autorequire:
|
11
16
|
bindir: bin
|
12
17
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
|
19
|
+
date: 2011-12-22 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
18
23
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 1
|
28
|
+
segments:
|
29
|
+
- 3
|
30
|
+
- 1
|
31
|
+
- 1
|
22
32
|
version: 3.1.1
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: *70329403038300
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
33
|
name: newrelic_rpm
|
28
|
-
|
34
|
+
prerelease: false
|
35
|
+
type: :runtime
|
36
|
+
requirement: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
29
39
|
none: false
|
30
|
-
requirements:
|
31
|
-
- -
|
32
|
-
- !ruby/object:Gem::Version
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 1
|
44
|
+
segments:
|
45
|
+
- 3
|
46
|
+
- 1
|
47
|
+
- 1
|
33
48
|
version: 3.1.1
|
34
|
-
|
49
|
+
name: newrelic_rpm
|
35
50
|
prerelease: false
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
51
|
+
type: :runtime
|
52
|
+
requirement: *id002
|
53
|
+
description: |
|
54
|
+
Community contributed instrumentation for various frameworks based on
|
40
55
|
the New Relic Ruby monitoring gem newrelic_rpm.
|
41
56
|
|
42
|
-
'
|
43
57
|
email: support@newrelic.com
|
44
58
|
executables: []
|
59
|
+
|
45
60
|
extensions: []
|
46
|
-
|
61
|
+
|
62
|
+
extra_rdoc_files:
|
47
63
|
- CHANGELOG
|
48
64
|
- LICENSE
|
49
65
|
- README.md
|
50
|
-
files:
|
66
|
+
files:
|
51
67
|
- CHANGELOG
|
52
68
|
- Gemfile
|
53
69
|
- LICENSE
|
@@ -69,6 +85,7 @@ files:
|
|
69
85
|
- lib/rpm_contrib/instrumentation/kyototycoon.rb
|
70
86
|
- lib/rpm_contrib/instrumentation/mongo.rb
|
71
87
|
- lib/rpm_contrib/instrumentation/paperclip.rb
|
88
|
+
- lib/rpm_contrib/instrumentation/picky.rb
|
72
89
|
- lib/rpm_contrib/instrumentation/redis.rb
|
73
90
|
- lib/rpm_contrib/instrumentation/resque.rb
|
74
91
|
- lib/rpm_contrib/instrumentation/riak_client.rb
|
@@ -84,40 +101,47 @@ files:
|
|
84
101
|
- test/helper.rb
|
85
102
|
- test/schema.rb
|
86
103
|
- test/test_curb.rb
|
104
|
+
- test/test_picky.rb
|
87
105
|
- test/test_redis.rb
|
88
106
|
- test/test_resque.rb
|
89
107
|
- test/test_workling.rb
|
90
108
|
homepage: http://github.com/newrelic/rpm_contrib
|
91
109
|
licenses: []
|
110
|
+
|
92
111
|
post_install_message:
|
93
|
-
rdoc_options:
|
112
|
+
rdoc_options:
|
94
113
|
- --line-numbers
|
95
114
|
- --inline-source
|
96
115
|
- --title
|
97
116
|
- Contributed Instrumentation for New Relic RPM
|
98
117
|
- -m
|
99
118
|
- README.md
|
100
|
-
require_paths:
|
119
|
+
require_paths:
|
101
120
|
- lib
|
102
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
103
122
|
none: false
|
104
|
-
requirements:
|
105
|
-
- -
|
106
|
-
- !ruby/object:Gem::Version
|
107
|
-
|
108
|
-
segments:
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
109
128
|
- 0
|
110
|
-
|
111
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
|
+
version: "0"
|
130
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
112
131
|
none: false
|
113
|
-
requirements:
|
114
|
-
- -
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
hash: 3
|
136
|
+
segments:
|
137
|
+
- 0
|
138
|
+
version: "0"
|
117
139
|
requirements: []
|
140
|
+
|
118
141
|
rubyforge_project:
|
119
142
|
rubygems_version: 1.8.10
|
120
143
|
signing_key:
|
121
144
|
specification_version: 3
|
122
145
|
summary: Contributed Instrumentation for New Relic RPM
|
123
146
|
test_files: []
|
147
|
+
|