newrelic-redis 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 28b9cfa808b80ff682a14999a13a5c0c9dac3c18
4
+ data.tar.gz: 6c59cfd9cc77752487d36880c5bc149bef109ca0
5
+ SHA512:
6
+ metadata.gz: c922be001df8876065c2b7f59160e8a53bfed58a0aa8fcef4700537208815a49daf0fef6c526aec7e2164f7623253eed0ce472ca66a1a5995fe3caa4d2a23dd4
7
+ data.tar.gz: 54f332a9d7a0270baa66e608b04b30b2502887462e42afd0c5c0dab0354c7e7d7c5b92663b151f021643f1445778bfdb848fc37efb73984f80f1a0defedc7c75
@@ -1,3 +1,8 @@
1
+ === 1.5.0 / 2014-08-25
2
+
3
+ * 1 feature:
4
+ * Respect the obfuscated configuration parameter for in redis
5
+
1
6
  === 1.4.0 / 2012-10-31
2
7
 
3
8
  HAPPY HALLOWEEN!
@@ -40,8 +40,7 @@ DependencyDetection.defer do
40
40
  begin
41
41
  call_without_newrelic_trace(*args, &blk)
42
42
  ensure
43
- s = NewRelic::Agent.instance.transaction_sampler
44
- s.notice_nosql(args.inspect, (Time.now - start).to_f) rescue nil
43
+ _send_to_new_relic(args, start)
45
44
  end
46
45
  end
47
46
  end
@@ -77,8 +76,7 @@ DependencyDetection.defer do
77
76
  begin
78
77
  call_pipelined_without_newrelic_trace commands, *rest
79
78
  ensure
80
- s = NewRelic::Agent.instance.transaction_sampler
81
- s.notice_nosql(commands.inspect, (Time.now - start).to_f) rescue nil
79
+ _send_to_new_relic(commands, start)
82
80
  end
83
81
  end
84
82
  end
@@ -86,9 +84,16 @@ DependencyDetection.defer do
86
84
  alias_method :call_pipelined_without_newrelic_trace, :call_pipelined
87
85
  alias_method :call_pipelined, :call_pipelined_with_newrelic_trace
88
86
  end
87
+
88
+ def _send_to_new_relic(args, start)
89
+ if NewRelic::Control.instance["transaction_tracer.record_sql"] == "obfuscated"
90
+ args.map! { |arg| [arg.first] + ["?"] * (arg.count - 1) }
91
+ end
92
+ s = NewRelic::Agent.instance.transaction_sampler
93
+ s.notice_nosql(args.inspect, (Time.now - start).to_f) rescue nil
94
+ end
89
95
  end
90
96
  end
91
-
92
97
  end
93
98
 
94
99
 
@@ -1,3 +1,3 @@
1
1
  class NewRelicRedis
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
@@ -71,4 +71,20 @@ class TestNewRelicRedis < Test::Unit::TestCase
71
71
  assert_nil rep
72
72
  end
73
73
  end
74
+
75
+ def test_obfuscated
76
+ NewRelic::Control.instance["transaction_tracer.record_sql"] = "obfuscated"
77
+ @redis.pipelined do
78
+ @redis.hgetall "foo"
79
+ @redis.incr "bar"
80
+ end
81
+
82
+ assert_metrics "Database/Redis/Pipelined",
83
+ "Database/Redis/Pipelined/HGETALL",
84
+ "Database/Redis/Pipelined/INCR",
85
+ "Database/Redis/allOther"
86
+
87
+ prm = @sampler.builder.current_segment.params
88
+ assert_equal "[[:select, \"?\"]];\n[[:hgetall, \"?\"], [:incr, \"?\"]]", prm[:key]
89
+ end
74
90
  end
metadata CHANGED
@@ -1,80 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
5
- prerelease:
4
+ version: 1.5.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Evan Phoenix
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-01 00:00:00.000000000 Z
11
+ date: 2014-08-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: redis
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - <
17
+ - - "<"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '4.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - <
24
+ - - "<"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '4.0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: newrelic_rpm
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - "~>"
36
32
  - !ruby/object:Gem::Version
37
33
  version: '3.0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - "~>"
44
39
  - !ruby/object:Gem::Version
45
40
  version: '3.0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rdoc
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '3.10'
47
+ version: '4.0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
- version: '3.10'
54
+ version: '4.0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: hoe
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ~>
59
+ - - "~>"
68
60
  - !ruby/object:Gem::Version
69
- version: '3.0'
61
+ version: '3.12'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ~>
66
+ - - "~>"
76
67
  - !ruby/object:Gem::Version
77
- version: '3.0'
68
+ version: '3.12'
78
69
  description: Redis instrumentation for Newrelic.
79
70
  email:
80
71
  - evan@phx.io
@@ -85,7 +76,8 @@ extra_rdoc_files:
85
76
  - Manifest.txt
86
77
  - README.txt
87
78
  files:
88
- - .autotest
79
+ - ".autotest"
80
+ - ".gemtest"
89
81
  - History.txt
90
82
  - Manifest.txt
91
83
  - README.txt
@@ -96,32 +88,31 @@ files:
96
88
  - newrelic-redis.gemspec
97
89
  - test/test.conf
98
90
  - test/test_newrelic_redis.rb
99
- - .gemtest
100
91
  homepage: http://github.com/evanphx/newrelic-redis
101
- licenses: []
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
102
95
  post_install_message:
103
96
  rdoc_options:
104
- - --main
97
+ - "--main"
105
98
  - README.txt
106
99
  require_paths:
107
100
  - lib
108
101
  required_ruby_version: !ruby/object:Gem::Requirement
109
- none: false
110
102
  requirements:
111
- - - ! '>='
103
+ - - ">="
112
104
  - !ruby/object:Gem::Version
113
105
  version: '0'
114
106
  required_rubygems_version: !ruby/object:Gem::Requirement
115
- none: false
116
107
  requirements:
117
- - - ! '>='
108
+ - - ">="
118
109
  - !ruby/object:Gem::Version
119
110
  version: '0'
120
111
  requirements: []
121
- rubyforge_project: newrelic-redis
122
- rubygems_version: 1.8.24
112
+ rubyforge_project:
113
+ rubygems_version: 2.2.2
123
114
  signing_key:
124
- specification_version: 3
115
+ specification_version: 4
125
116
  summary: Redis instrumentation for Newrelic.
126
117
  test_files:
127
118
  - test/test_newrelic_redis.rb