newrelic_rpm 3.1.1 → 3.1.2.beta1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of newrelic_rpm might be problematic. Click here for more details.

Files changed (30) hide show
  1. data/CHANGELOG +6 -0
  2. data/lib/new_relic/agent/agent.rb +3 -11
  3. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  4. data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +3 -2
  5. data/lib/new_relic/agent/instrumentation/net.rb +1 -1
  6. data/lib/new_relic/agent/instrumentation/rails/active_record_instrumentation.rb +1 -0
  7. data/lib/new_relic/agent/instrumentation/rails3/active_record_instrumentation.rb +1 -0
  8. data/lib/new_relic/agent/samplers/memory_sampler.rb +1 -1
  9. data/lib/new_relic/agent/shim_agent.rb +4 -4
  10. data/lib/new_relic/agent/stats_engine/metric_stats.rb +11 -24
  11. data/lib/new_relic/control/frameworks/rails.rb +7 -2
  12. data/lib/new_relic/control/frameworks/rails3.rb +5 -2
  13. data/lib/new_relic/control/instance_methods.rb +9 -2
  14. data/lib/new_relic/data_serialization.rb +35 -34
  15. data/lib/new_relic/language_support.rb +66 -0
  16. data/lib/new_relic/transaction_sample.rb +9 -7
  17. data/lib/new_relic/transaction_sample/segment.rb +28 -22
  18. data/lib/new_relic/version.rb +2 -2
  19. data/newrelic_rpm.gemspec +4 -3
  20. data/test/new_relic/agent/agent/start_test.rb +7 -7
  21. data/test/new_relic/agent/agent_test.rb +20 -1
  22. data/test/new_relic/agent/instrumentation/active_record_instrumentation_test.rb +20 -18
  23. data/test/new_relic/agent/instrumentation/instrumentation_test.rb +1 -1
  24. data/test/new_relic/agent/instrumentation/net_instrumentation_test.rb +6 -6
  25. data/test/new_relic/agent/transaction_sample_builder_test.rb +1 -1
  26. data/test/new_relic/data_serialization_test.rb +73 -3
  27. data/test/new_relic/transaction_sample/segment_test.rb +26 -16
  28. data/test/new_relic/transaction_sample_test.rb +11 -17
  29. data/test/test_helper.rb +12 -2
  30. metadata +66 -98
@@ -6,7 +6,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
6
6
 
7
7
  def setup
8
8
  @connection_stub = Mocha::Mockery.instance.named_mock('connection')
9
- @connection_stub.stubs(:execute).returns('QUERY RESULT')
9
+ @connection_stub.stubs(:execute).returns([['QUERY RESULT']])
10
10
 
11
11
  NewRelic::TransactionSample.stubs(:get_connection).returns @connection_stub
12
12
  @t = make_sql_transaction(::SQL_STATEMENT, ::SQL_STATEMENT)
@@ -19,7 +19,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
19
19
  def test_not_record_sql_when_record_sql_off
20
20
  s = @t.prepare_to_send(:explain_sql => 0.00000001)
21
21
  s.each_segment do |segment|
22
- assert_nil segment.params[:explanation]
22
+ assert_nil segment.params[:explain_plan]
23
23
  assert_nil segment.params[:sql]
24
24
  end
25
25
  end
@@ -29,7 +29,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
29
29
  got_one = false
30
30
  s.each_segment do |segment|
31
31
  fail if segment.params[:obfuscated_sql]
32
- got_one = got_one || segment.params[:explanation] || segment.params[:sql]
32
+ got_one = got_one || segment.params[:explain_plan] || segment.params[:sql]
33
33
  end
34
34
  assert got_one
35
35
  end
@@ -40,7 +40,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
40
40
 
41
41
  got_one = false
42
42
  s.each_segment do |segment|
43
- got_one = got_one || segment.params[:explanation] || segment.params[:sql]
43
+ got_one = got_one || segment.params[:explain_plan] || segment.params[:sql]
44
44
  end
45
45
 
46
46
  assert got_one
@@ -77,22 +77,16 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
77
77
  end
78
78
 
79
79
  def test_have_explains
80
-
81
80
  s = @t.prepare_to_send(:record_sql => :obfuscated, :explain_sql => 0.00000001)
82
-
83
- explain_count = 0
81
+
84
82
  s.each_segment do |segment|
85
- if segment.params[:explanation]
86
- explanations = segment.params[:explanation]
87
-
88
- explanations.each do |explanation|
89
- assert_kind_of Array, explanation
90
- assert_equal "QUERY RESULT", explanation.join('')
91
- explain_count += 1
92
- end
83
+ if segment.params[:explain_plan]
84
+ explanation = segment.params[:explain_plan]
85
+
86
+ assert_kind_of Array, explanation
87
+ assert_equal([nil, ["QUERY RESULT"]], explanation)
93
88
  end
94
89
  end
95
- assert_equal 2, explain_count
96
90
  end
97
91
 
98
92
  def test_not_record_sql_without_record_sql_option
@@ -104,7 +98,7 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
104
98
  s = t.prepare_to_send(:explain_sql => 0.00000001)
105
99
 
106
100
  s.each_segment do |segment|
107
- assert_nil segment.params[:explanation]
101
+ assert_nil segment.params[:explain_plan]
108
102
  assert_nil segment.params[:sql]
109
103
  end
110
104
  end
data/test/test_helper.rb CHANGED
@@ -21,8 +21,18 @@ begin
21
21
  end
22
22
 
23
23
  rescue LoadError
24
- puts "Unable to load Rails for New Relic tests"
25
- raise
24
+ # To run the tests against a standalone agent build, you need to
25
+ # add a rails app to the load path. It can be 2.* to 3.*. It should
26
+ # referenc newrelic_rpm in the Gemfile with a :path option pointing
27
+ # to this work directory.
28
+ guess = File.expand_path("../../../rpm", __FILE__)
29
+ if $LOAD_PATH.include? guess
30
+ puts "Unable to load Rails for New Relic tests. See note in test_helper.rb"
31
+ raise
32
+ else
33
+ $LOAD_PATH << guess
34
+ retry
35
+ end
26
36
  end
27
37
  require 'newrelic_rpm'
28
38
 
metadata CHANGED
@@ -1,15 +1,10 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
- version: !ruby/object:Gem::Version
4
- hash: 1
5
- prerelease:
6
- segments:
7
- - 3
8
- - 1
9
- - 1
10
- version: 3.1.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.1.2.beta1
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Bill Kayser
14
9
  - Jon Guymon
15
10
  - Justin George
@@ -17,73 +12,67 @@ authors:
17
12
  autorequire:
18
13
  bindir: bin
19
14
  cert_chain: []
20
-
21
- date: 2011-07-28 00:00:00 -07:00
15
+ date: 2011-08-18 00:00:00.000000000 -07:00
22
16
  default_executable:
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
17
+ dependencies:
18
+ - !ruby/object:Gem::Dependency
25
19
  name: jeweler
26
- prerelease: false
27
- requirement: &id001 !ruby/object:Gem::Requirement
20
+ requirement: &2164283560 !ruby/object:Gem::Requirement
28
21
  none: false
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- hash: 3
33
- segments:
34
- - 0
35
- version: "0"
22
+ requirements:
23
+ - - ! '>='
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
36
26
  type: :development
37
- version_requirements: *id001
38
- - !ruby/object:Gem::Dependency
39
- name: mocha
40
27
  prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
28
+ version_requirements: *2164283560
29
+ - !ruby/object:Gem::Dependency
30
+ name: mocha
31
+ requirement: &2155997140 !ruby/object:Gem::Requirement
42
32
  none: false
43
- requirements:
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- hash: 3
47
- segments:
48
- - 0
49
- version: "0"
33
+ requirements:
34
+ - - ! '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
50
37
  type: :development
51
- version_requirements: *id002
52
- - !ruby/object:Gem::Dependency
53
- name: shoulda
54
38
  prerelease: false
55
- requirement: &id003 !ruby/object:Gem::Requirement
39
+ version_requirements: *2155997140
40
+ - !ruby/object:Gem::Dependency
41
+ name: shoulda
42
+ requirement: &2155996160 !ruby/object:Gem::Requirement
56
43
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
64
48
  type: :development
65
- version_requirements: *id003
66
- description: |
67
- New Relic is a performance management system, developed by New Relic,
49
+ prerelease: false
50
+ version_requirements: *2155996160
51
+ description: ! 'New Relic is a performance management system, developed by New Relic,
52
+
68
53
  Inc (http://www.newrelic.com). New Relic provides you with deep
54
+
69
55
  information about the performance of your web application as it runs
56
+
70
57
  in production. The New Relic Ruby Agent is dual-purposed as a either a
58
+
71
59
  Gem or plugin, hosted on
60
+
72
61
  http://github.com/newrelic/rpm/
73
62
 
63
+ '
74
64
  email: support@newrelic.com
75
- executables:
76
- - newrelic_cmd
77
- - newrelic
65
+ executables:
78
66
  - mongrel_rpm
67
+ - newrelic
68
+ - newrelic_cmd
79
69
  extensions: []
80
-
81
- extra_rdoc_files:
70
+ extra_rdoc_files:
82
71
  - CHANGELOG
83
72
  - LICENSE
84
73
  - README.rdoc
85
74
  - newrelic.yml
86
- files:
75
+ files:
87
76
  - CHANGELOG
88
77
  - LICENSE
89
78
  - README.rdoc
@@ -164,6 +153,7 @@ files:
164
153
  - lib/new_relic/control/server_methods.rb
165
154
  - lib/new_relic/data_serialization.rb
166
155
  - lib/new_relic/delayed_job_injection.rb
156
+ - lib/new_relic/language_support.rb
167
157
  - lib/new_relic/local_environment.rb
168
158
  - lib/new_relic/merbtasks.rb
169
159
  - lib/new_relic/metric_data.rb
@@ -337,60 +327,38 @@ files:
337
327
  has_rdoc: true
338
328
  homepage: http://www.github.com/newrelic/rpm
339
329
  licenses: []
340
-
341
- post_install_message: |
342
-
343
- PLEASE NOTE:
344
-
345
- Developer Mode is now a Rack middleware.
346
-
347
- Developer Mode is no longer available in Rails 2.1 and earlier.
348
- However, starting in version 2.12 you can use Developer Mode in any
349
- Rack based framework, in addition to Rails. To install developer mode
350
- in a non-Rails application, just add NewRelic::Rack::DeveloperMode to
351
- your middleware stack.
352
-
353
- If you are using JRuby, we recommend using at least version 1.4 or
354
- later because of issues with the implementation of the timeout library.
355
-
356
- Refer to the README.md file for more information.
357
-
358
- Please see http://github.com/newrelic/rpm/blob/master/CHANGELOG
359
- for a complete description of the features and enhancements available
360
- in version 3.1 of the Ruby Agent.
361
-
362
-
363
- rdoc_options:
330
+ post_install_message: ! "\nPLEASE NOTE:\n\nDeveloper Mode is now a Rack middleware.\n\nDeveloper
331
+ Mode is no longer available in Rails 2.1 and earlier.\nHowever, starting in version
332
+ 2.12 you can use Developer Mode in any\nRack based framework, in addition to Rails.
333
+ \ To install developer mode\nin a non-Rails application, just add NewRelic::Rack::DeveloperMode
334
+ to\nyour middleware stack.\n\nIf you are using JRuby, we recommend using at least
335
+ version 1.4 or \nlater because of issues with the implementation of the timeout
336
+ library.\n\nRefer to the README.md file for more information.\n\nPlease see http://github.com/newrelic/rpm/blob/master/CHANGELOG\nfor
337
+ a complete description of the features and enhancements available\nin version 3.1
338
+ of the Ruby Agent.\n \n"
339
+ rdoc_options:
364
340
  - --line-numbers
365
341
  - --inline-source
366
342
  - --title
367
343
  - New Relic Ruby Agent
368
- require_paths:
344
+ require_paths:
369
345
  - lib
370
- required_ruby_version: !ruby/object:Gem::Requirement
346
+ required_ruby_version: !ruby/object:Gem::Requirement
371
347
  none: false
372
- requirements:
373
- - - ">="
374
- - !ruby/object:Gem::Version
375
- hash: 3
376
- segments:
377
- - 0
378
- version: "0"
379
- required_rubygems_version: !ruby/object:Gem::Requirement
348
+ requirements:
349
+ - - ! '>='
350
+ - !ruby/object:Gem::Version
351
+ version: '0'
352
+ required_rubygems_version: !ruby/object:Gem::Requirement
380
353
  none: false
381
- requirements:
382
- - - ">="
383
- - !ruby/object:Gem::Version
384
- hash: 3
385
- segments:
386
- - 0
387
- version: "0"
354
+ requirements:
355
+ - - ! '>='
356
+ - !ruby/object:Gem::Version
357
+ version: '0'
388
358
  requirements: []
389
-
390
359
  rubyforge_project:
391
- rubygems_version: 1.4.2
360
+ rubygems_version: 1.6.2
392
361
  signing_key:
393
362
  specification_version: 3
394
363
  summary: New Relic Ruby Agent
395
364
  test_files: []
396
-