newrelic_rpm 3.12.1.298 → 3.13.0.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +37 -0
  3. data/GUIDELINES_FOR_CONTRIBUTING.md +1 -1
  4. data/LICENSE +4 -4
  5. data/README.md +3 -3
  6. data/lib/new_relic/agent/agent.rb +27 -0
  7. data/lib/new_relic/agent/commands/thread_profiler_session.rb +2 -0
  8. data/lib/new_relic/agent/configuration/default_source.rb +51 -1
  9. data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
  10. data/lib/new_relic/agent/database.rb +12 -2
  11. data/lib/new_relic/agent/database/obfuscator.rb +4 -3
  12. data/lib/new_relic/agent/datastores.rb +1 -1
  13. data/lib/new_relic/agent/datastores/redis.rb +131 -0
  14. data/lib/new_relic/agent/error_collector.rb +2 -2
  15. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -0
  16. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -0
  17. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +2 -0
  18. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +2 -0
  19. data/lib/new_relic/agent/instrumentation/rake.rb +170 -0
  20. data/lib/new_relic/agent/instrumentation/redis.rb +71 -0
  21. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -0
  22. data/lib/new_relic/agent/new_relic_service.rb +4 -0
  23. data/lib/new_relic/agent/sql_sampler.rb +14 -13
  24. data/lib/new_relic/agent/stats_engine/gc_profiler.rb +1 -0
  25. data/lib/new_relic/agent/transaction.rb +2 -0
  26. data/lib/new_relic/agent/transaction/attributes.rb +1 -1
  27. data/lib/new_relic/agent/transaction/trace.rb +2 -1
  28. data/lib/new_relic/agent/transaction/trace_node.rb +3 -2
  29. data/lib/new_relic/agent/transaction_sampler.rb +4 -15
  30. data/lib/new_relic/agent/transaction_state.rb +1 -0
  31. data/lib/new_relic/agent/vm/rubinius_vm.rb +27 -19
  32. data/lib/new_relic/language_support.rb +7 -0
  33. data/lib/new_relic/version.rb +2 -2
  34. data/lib/tasks/newrelic.rb +9 -0
  35. data/newrelic_rpm.gemspec +1 -1
  36. data/test/multiverse/README.md +1 -1
  37. data/test/multiverse/lib/multiverse/runner.rb +2 -2
  38. data/test/multiverse/suites/active_record/active_record_test.rb +6 -6
  39. data/test/multiverse/suites/agent_only/agent_attributes_test.rb +11 -0
  40. data/test/multiverse/suites/agent_only/script/warnings.rb +15 -0
  41. data/test/multiverse/suites/agent_only/start_up_test.rb +12 -4
  42. data/test/multiverse/suites/rake/Envfile +37 -0
  43. data/test/multiverse/suites/rake/Rakefile +54 -0
  44. data/test/multiverse/suites/rake/config/newrelic.yml +18 -0
  45. data/test/multiverse/suites/rake/multitask_test.rb +40 -0
  46. data/test/multiverse/suites/rake/rake_test.rb +209 -0
  47. data/test/multiverse/suites/rake/rake_test_helper.rb +66 -0
  48. data/test/multiverse/suites/rake/unsupported_rake_test.rb +19 -0
  49. data/test/multiverse/suites/redis/Envfile +14 -0
  50. data/test/multiverse/suites/redis/config/newrelic.yml +19 -0
  51. data/test/multiverse/suites/redis/redis_instrumentation_test.rb +212 -0
  52. data/test/multiverse/suites/redis/redis_unsupported_version_test.rb +20 -0
  53. data/test/multiverse/suites/resque/resque_marshalling_test.rb +9 -1
  54. data/test/new_relic/agent/agent_test.rb +78 -1
  55. data/test/new_relic/agent/configuration/high_security_source_test.rb +9 -0
  56. data/test/new_relic/agent/database/sql_obfuscation_test.rb +1 -3
  57. data/test/new_relic/agent/datastores/redis_test.rb +128 -0
  58. data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +1 -1
  59. data/test/new_relic/agent/sql_sampler_test.rb +64 -52
  60. data/test/new_relic/agent/transaction/trace_node_test.rb +1 -1
  61. data/test/new_relic/agent/transaction/trace_test.rb +1 -1
  62. data/test/new_relic/agent/transaction_sampler_test.rb +9 -11
  63. data/test/new_relic/agent/vm/rubinius_vm_test.rb +1 -1
  64. data/test/new_relic/fake_collector.rb +18 -1
  65. data/test/new_relic/multiverse_helpers.rb +6 -0
  66. data/test/performance/suites/redis.rb +45 -0
  67. data/ui/views/newrelic/_sql_row.rhtml +1 -1
  68. data/ui/views/newrelic/explain_sql.rhtml +1 -1
  69. metadata +21 -5
@@ -45,7 +45,7 @@ if NewRelic::LanguageSupport.rubinius?
45
45
  def test_gather_stats_from_metrics_sets_total_allocated_objects
46
46
  @vm.gather_stats_from_metrics(@snap)
47
47
 
48
- refute_nil @snap.total_allocated_object
48
+ refute_nil @snap.total_allocated_object if @vm.supports?(:total_allocated_object)
49
49
  end
50
50
 
51
51
  def test_gather_stats_from_metrics_sets_method_cache_invalidations
@@ -99,6 +99,11 @@ module NewRelic
99
99
  self.mock[method].override(status, {'exception' => exception})
100
100
  end
101
101
 
102
+ def stub_wait(method, wait_time, status=200)
103
+ self.mock[method] ||= default_response
104
+ self.mock[method].override(status, Proc.new { sleep(wait_time); {'return_value' => ""}})
105
+ end
106
+
102
107
  def call(env)
103
108
  @last_socket = Thread.current[:WEBrickSocket]
104
109
 
@@ -313,11 +318,23 @@ module NewRelic
313
318
  end
314
319
 
315
320
  class SubmittedTransactionTraceTree
316
- attr_reader :attributes
321
+ attr_reader :attributes, :nodes, :node_params
317
322
 
318
323
  def initialize(body, format)
319
324
  @body = body
320
325
  @attributes = body[4]
326
+ @nodes = extract_by_index(body[3], 2)
327
+ @node_params = extract_by_index(body[3], 3)
328
+ end
329
+
330
+ def extract_by_index(current, index)
331
+ result = [current[index]]
332
+ if current[4].any?
333
+ current[4].each do |child|
334
+ result << extract_by_index(child, index)
335
+ end
336
+ end
337
+ result
321
338
  end
322
339
  end
323
340
 
@@ -156,6 +156,12 @@ module MultiverseHelpers
156
156
  $collector.calls_for("analytic_event_data").first.events.first
157
157
  end
158
158
 
159
+ def single_metrics_post
160
+ assert_equal 1, $collector.calls_for("metric_data").length
161
+
162
+ $collector.calls_for("metric_data").first
163
+ end
164
+
159
165
  def single_connect_posted
160
166
  assert_equal 1, $collector.calls_for(:connect).size
161
167
  $collector.calls_for(:connect).first
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
+
5
+ # Primarily just tests allocations around argument formatting
6
+ class Redis < Performance::TestCase
7
+ def test_no_args
8
+ with_config(:'transaction_tracer.record_redis_arguments' => true) do
9
+ command = ["lonely_command"]
10
+ measure do
11
+ NewRelic::Agent::Datastores::Redis.format_command(command)
12
+ end
13
+ end
14
+ end
15
+
16
+ def test_args
17
+ with_config(:'transaction_tracer.record_redis_arguments' => true) do
18
+ commands = ["argumentative", "commands", "get", "called", "a", "bunch"]
19
+ measure do
20
+ NewRelic::Agent::Datastores::Redis.format_command(commands)
21
+ end
22
+ end
23
+ end
24
+
25
+ def test_long_args
26
+ with_config(:'transaction_tracer.record_redis_arguments' => true) do
27
+ commands = ["loooooong_command", "a" * 100, "b" * 100, "c" * 100]
28
+ measure do
29
+ NewRelic::Agent::Datastores::Redis.format_command(commands)
30
+ end
31
+ end
32
+ end
33
+
34
+ def test_pipelined
35
+ with_config(:'transaction_tracer.record_redis_arguments' => true) do
36
+ pipeline = [
37
+ ["first", "a" * 100, "b" * 100, "c" * 100],
38
+ ["second", "a" * 100, "b" * 100, "c" * 100]]
39
+
40
+ measure do
41
+ NewRelic::Agent::Datastores::Redis.format_pipeline_commands(pipeline)
42
+ end
43
+ end
44
+ end
45
+ end
@@ -7,7 +7,7 @@
7
7
  <div class="sql_statement">
8
8
  <small>
9
9
  <% if segment[:sql] %>
10
- <%= line_wrap_sql(segment[:sql] ) %>
10
+ <%= line_wrap_sql(segment[:sql].sql ) %>
11
11
  <% else %>
12
12
  Non-sql query: <%= segment.metric_name %> <%= line_wrap_sql(segment[:key]) %>
13
13
  <% end %></small>
@@ -9,7 +9,7 @@
9
9
  </th>
10
10
  <td colspan=<%= colspan %>><small>
11
11
  <div class="sql_statement">
12
- <%= line_wrap_sql(@sql) %>
12
+ <%= line_wrap_sql(@sql.sql) %>
13
13
  </div>
14
14
  </small></td>
15
15
  </tr>
metadata CHANGED
@@ -1,18 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.12.1.298
4
+ version: 3.13.0.299
5
5
  platform: ruby
6
6
  authors:
7
- - Jason Clark
8
7
  - Tim Krajcar
9
- - Jonan Scheffler
10
8
  - Matthew Wear
11
- - Ben Weintraub
9
+ - Katherine Wu
12
10
  autorequire:
13
11
  bindir: bin
14
12
  cert_chain: []
15
- date: 2015-06-18 00:00:00.000000000 Z
13
+ date: 2015-07-27 00:00:00.000000000 Z
16
14
  dependencies:
17
15
  - !ruby/object:Gem::Dependency
18
16
  name: rake
@@ -263,6 +261,7 @@ files:
263
261
  - lib/new_relic/agent/datastores/mongo/metric_translator.rb
264
262
  - lib/new_relic/agent/datastores/mongo/obfuscator.rb
265
263
  - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
264
+ - lib/new_relic/agent/datastores/redis.rb
266
265
  - lib/new_relic/agent/deprecator.rb
267
266
  - lib/new_relic/agent/encoding_normalizer.rb
268
267
  - lib/new_relic/agent/error_collector.rb
@@ -323,6 +322,8 @@ files:
323
322
  - lib/new_relic/agent/instrumentation/rails4/errors.rb
324
323
  - lib/new_relic/agent/instrumentation/rails_middleware.rb
325
324
  - lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb
325
+ - lib/new_relic/agent/instrumentation/rake.rb
326
+ - lib/new_relic/agent/instrumentation/redis.rb
326
327
  - lib/new_relic/agent/instrumentation/resque.rb
327
328
  - lib/new_relic/agent/instrumentation/rubyprof.rb
328
329
  - lib/new_relic/agent/instrumentation/sequel.rb
@@ -454,6 +455,7 @@ files:
454
455
  - lib/tasks/install.rake
455
456
  - lib/tasks/multiverse.rake
456
457
  - lib/tasks/multiverse.rb
458
+ - lib/tasks/newrelic.rb
457
459
  - lib/tasks/tests.rake
458
460
  - lib/tasks/versions.html.erb
459
461
  - lib/tasks/versions.rake
@@ -765,6 +767,7 @@ files:
765
767
  - test/multiverse/suites/agent_only/script/loading.rb
766
768
  - test/multiverse/suites/agent_only/script/public_api_when_disabled.rb
767
769
  - test/multiverse/suites/agent_only/script/symbol_env.rb
770
+ - test/multiverse/suites/agent_only/script/warnings.rb
768
771
  - test/multiverse/suites/agent_only/service_timeout_test.rb
769
772
  - test/multiverse/suites/agent_only/set_transaction_name_test.rb
770
773
  - test/multiverse/suites/agent_only/ssl_test.rb
@@ -892,6 +895,17 @@ files:
892
895
  - test/multiverse/suites/rails/request_statistics_test.rb
893
896
  - test/multiverse/suites/rails/transaction_ignoring_test.rb
894
897
  - test/multiverse/suites/rails/view_instrumentation_test.rb
898
+ - test/multiverse/suites/rake/Envfile
899
+ - test/multiverse/suites/rake/Rakefile
900
+ - test/multiverse/suites/rake/config/newrelic.yml
901
+ - test/multiverse/suites/rake/multitask_test.rb
902
+ - test/multiverse/suites/rake/rake_test.rb
903
+ - test/multiverse/suites/rake/rake_test_helper.rb
904
+ - test/multiverse/suites/rake/unsupported_rake_test.rb
905
+ - test/multiverse/suites/redis/Envfile
906
+ - test/multiverse/suites/redis/config/newrelic.yml
907
+ - test/multiverse/suites/redis/redis_instrumentation_test.rb
908
+ - test/multiverse/suites/redis/redis_unsupported_version_test.rb
895
909
  - test/multiverse/suites/resque/Envfile
896
910
  - test/multiverse/suites/resque/Rakefile
897
911
  - test/multiverse/suites/resque/config/newrelic.yml
@@ -979,6 +993,7 @@ files:
979
993
  - test/new_relic/agent/datastores/mongo/metric_translator_test.rb
980
994
  - test/new_relic/agent/datastores/mongo/obfuscator_test.rb
981
995
  - test/new_relic/agent/datastores/mongo/statement_formatter_test.rb
996
+ - test/new_relic/agent/datastores/redis_test.rb
982
997
  - test/new_relic/agent/datastores_test.rb
983
998
  - test/new_relic/agent/deprecator_test.rb
984
999
  - test/new_relic/agent/encoding_normalizer_test.rb
@@ -1144,6 +1159,7 @@ files:
1144
1159
  - test/performance/suites/marshalling.rb
1145
1160
  - test/performance/suites/queue_time.rb
1146
1161
  - test/performance/suites/rack_middleware.rb
1162
+ - test/performance/suites/redis.rb
1147
1163
  - test/performance/suites/rum_autoinsertion.rb
1148
1164
  - test/performance/suites/sql_obfuscation.rb
1149
1165
  - test/performance/suites/startup.rb