newrelic_rpm 3.5.6.48.beta → 3.5.6.55
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gitignore +1 -0
- data/CHANGELOG +52 -0
- data/gem-public_cert.pem +20 -0
- data/lib/new_relic/agent.rb +3 -0
- data/lib/new_relic/agent/agent.rb +21 -14
- data/lib/new_relic/agent/agent_logger.rb +9 -1
- data/lib/new_relic/agent/configuration/defaults.rb +3 -3
- data/lib/new_relic/agent/configuration/mask_defaults.rb +1 -0
- data/lib/new_relic/agent/error_collector.rb +11 -2
- data/lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb +2 -2
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra.rb +10 -2
- data/lib/new_relic/agent/new_relic_service.rb +90 -10
- data/lib/new_relic/agent/pipe_service.rb +9 -0
- data/lib/new_relic/agent/sql_sampler.rb +10 -3
- data/lib/new_relic/agent/thread_profiler.rb +20 -7
- data/lib/new_relic/coerce.rb +37 -0
- data/lib/new_relic/commands/deployments.rb +1 -1
- data/lib/new_relic/control/frameworks/rails.rb +12 -2
- data/lib/new_relic/control/frameworks/rails3.rb +2 -11
- data/lib/new_relic/control/instance_methods.rb +10 -6
- data/lib/new_relic/control/server_methods.rb +5 -37
- data/lib/new_relic/local_environment.rb +1 -1
- data/lib/new_relic/metric_data.rb +13 -2
- data/lib/new_relic/noticed_error.rb +8 -1
- data/lib/new_relic/transaction_sample.rb +12 -3
- data/lib/new_relic/transaction_sample/segment.rb +6 -3
- data/newrelic.yml +6 -19
- data/newrelic_rpm.gemspec +7 -0
- data/test/multiverse/lib/multiverse/environment.rb +1 -1
- data/test/multiverse/suites/agent_only/logging_test.rb +19 -0
- data/test/multiverse/suites/agent_only/ssl_test.rb +22 -0
- data/test/multiverse/suites/rails/config/newrelic.yml +3 -136
- data/test/multiverse/suites/rails/error_tracing_test.rb +39 -21
- data/test/multiverse/suites/rails/gc_instrumentation_test.rb +26 -24
- data/test/multiverse/suites/resque/Rakefile +6 -0
- data/test/multiverse/suites/resque/instrumentation_test.rb +18 -5
- data/test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb +38 -0
- data/test/multiverse/suites/sinatra/sinatra_test.rb +17 -0
- data/test/new_relic/agent/agent/connect_test.rb +7 -26
- data/test/new_relic/agent/agent_test.rb +27 -31
- data/test/new_relic/agent/browser_monitoring_test.rb +1 -1
- data/test/new_relic/agent/error_collector_test.rb +16 -0
- data/test/new_relic/agent/instrumentation/browser_monitoring_timings_test.rb +1 -1
- data/test/new_relic/agent/instrumentation/task_instrumentation_test.rb +1 -0
- data/test/new_relic/agent/new_relic_service_test.rb +95 -2
- data/test/new_relic/agent/pipe_channel_manager_test.rb +3 -3
- data/test/new_relic/agent/pipe_service_test.rb +21 -1
- data/test/new_relic/agent/rpm_agent_test.rb +1 -1
- data/test/new_relic/agent/sql_sampler_test.rb +20 -0
- data/test/new_relic/agent/thread_profiler_test.rb +53 -8
- data/test/new_relic/agent/worker_loop_test.rb +4 -8
- data/test/new_relic/agent_test.rb +1 -2
- data/test/new_relic/coerce_test.rb +65 -0
- data/test/new_relic/command/deployments_test.rb +1 -1
- data/test/new_relic/control_test.rb +19 -44
- data/test/new_relic/fake_collector.rb +3 -2
- data/test/new_relic/local_environment_test.rb +1 -1
- data/test/new_relic/metric_data_test.rb +29 -0
- data/test/new_relic/noticed_error_test.rb +8 -0
- data/test/new_relic/transaction_sample/segment_test.rb +7 -0
- data/test/new_relic/transaction_sample_test.rb +36 -8
- data/test/test_contexts.rb +1 -1
- data/test/test_helper.rb +21 -2
- data/ui/helpers/google_pie_chart.rb +1 -0
- metadata +68 -10
- metadata.gz.sig +0 -0
- data/test/new_relic/fake_service.rb +0 -53
@@ -51,6 +51,13 @@ class NewRelic::TransactionSample::SegmentTest < Test::Unit::TestCase
|
|
51
51
|
assert_equal(expected_array, parent.to_array)
|
52
52
|
end
|
53
53
|
|
54
|
+
def test_to_array_with_bad_values
|
55
|
+
segment = NewRelic::TransactionSample::Segment.new(nil, nil, nil)
|
56
|
+
segment.end_trace(Rational(10, 1))
|
57
|
+
expected = [0, 10_000.0, "<unknown>", {}, []]
|
58
|
+
assert_equal(expected, segment.to_array)
|
59
|
+
end
|
60
|
+
|
54
61
|
if RUBY_VERSION >= '1.9.2'
|
55
62
|
def test_to_json
|
56
63
|
parent = NewRelic::TransactionSample::Segment.new(1, 'Custom/test/parent', 1)
|
@@ -12,6 +12,12 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
|
|
12
12
|
|
13
13
|
NewRelic::Agent::Database.stubs(:get_connection).returns @connection_stub
|
14
14
|
@t = make_sql_transaction(::SQL_STATEMENT, ::SQL_STATEMENT)
|
15
|
+
|
16
|
+
if NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
|
17
|
+
@marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
|
18
|
+
else
|
19
|
+
@marshaller = NewRelic::Agent::NewRelicService::PrubyMarshaller.new
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
23
|
def teardown
|
@@ -189,6 +195,13 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
|
|
189
195
|
assert_equal expected_array, @t.to_array
|
190
196
|
end
|
191
197
|
|
198
|
+
|
199
|
+
def test_to_array_with_bad_values
|
200
|
+
transaction = NewRelic::TransactionSample.new(nil)
|
201
|
+
expected = [0.0, {}, nil, [0, 0, "ROOT", {}, []]]
|
202
|
+
assert_equal expected, transaction.to_array
|
203
|
+
end
|
204
|
+
|
192
205
|
if RUBY_VERSION >= '1.9.2'
|
193
206
|
def test_to_json
|
194
207
|
expected_string = JSON.dump([@t.start_time.to_f,
|
@@ -200,20 +213,35 @@ class NewRelic::TransactionSampleTest < Test::Unit::TestCase
|
|
200
213
|
end
|
201
214
|
|
202
215
|
def test_to_collector_array
|
203
|
-
if NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
|
204
|
-
marshaller = NewRelic::Agent::NewRelicService::JsonMarshaller.new
|
205
|
-
trace_tree = compress(@t.to_json)
|
206
|
-
else
|
207
|
-
marshaller = NewRelic::Agent::NewRelicService::PrubyMarshaller.new
|
208
|
-
trace_tree = @t.to_array
|
209
|
-
end
|
210
216
|
expected_array = [(@t.start_time.to_f * 1000).round,
|
211
217
|
(@t.duration * 1000).round,
|
212
218
|
@t.params[:path], @t.params[:uri],
|
213
219
|
trace_tree,
|
214
220
|
@t.guid, nil, !!@t.force_persist]
|
215
221
|
|
216
|
-
assert_equal expected_array, @t.to_collector_array(marshaller.default_encoder)
|
222
|
+
assert_equal expected_array, @t.to_collector_array(@marshaller.default_encoder)
|
223
|
+
end
|
224
|
+
|
225
|
+
def test_to_collector_array_with_bad_values
|
226
|
+
transaction = NewRelic::TransactionSample.new(nil)
|
227
|
+
transaction.root_segment.end_trace(Rational(10, 1))
|
228
|
+
|
229
|
+
expected = [
|
230
|
+
0, 10_000,
|
231
|
+
nil, nil,
|
232
|
+
trace_tree(transaction),
|
233
|
+
transaction.guid,
|
234
|
+
nil, false]
|
235
|
+
|
236
|
+
assert_equal expected, transaction.to_collector_array(@marshaller.default_encoder)
|
237
|
+
end
|
238
|
+
|
239
|
+
def trace_tree(transaction=@t)
|
240
|
+
if NewRelic::Agent::NewRelicService::JsonMarshaller.is_supported?
|
241
|
+
trace_tree = compress(transaction.to_json)
|
242
|
+
else
|
243
|
+
trace_tree = transaction.to_array
|
244
|
+
end
|
217
245
|
end
|
218
246
|
|
219
247
|
def compress(string)
|
data/test/test_contexts.rb
CHANGED
@@ -7,7 +7,7 @@ module TestContexts
|
|
7
7
|
setup do
|
8
8
|
@log_data = StringIO.new
|
9
9
|
@log = Logger.new(@log_data)
|
10
|
-
NewRelic::Agent::Agent.instance.service =
|
10
|
+
NewRelic::Agent::Agent.instance.service = default_service
|
11
11
|
NewRelic::Agent.manual_start :log => @log
|
12
12
|
@agent = NewRelic::Agent.instance
|
13
13
|
@agent.metric_ids.clear
|
data/test/test_helper.rb
CHANGED
@@ -44,7 +44,6 @@ end
|
|
44
44
|
|
45
45
|
require 'test/unit'
|
46
46
|
require 'shoulda'
|
47
|
-
require 'test_contexts'
|
48
47
|
require 'mocha'
|
49
48
|
|
50
49
|
begin # 1.8.6
|
@@ -53,7 +52,27 @@ begin # 1.8.6
|
|
53
52
|
rescue LoadError
|
54
53
|
end
|
55
54
|
|
56
|
-
|
55
|
+
def default_service(stubbed_method_overrides = {})
|
56
|
+
service = stub
|
57
|
+
stubbed_method_defaults = {
|
58
|
+
:connect => {},
|
59
|
+
:shutdown => nil,
|
60
|
+
:agent_id= => nil,
|
61
|
+
:agent_id => nil,
|
62
|
+
:collector => stub_everything,
|
63
|
+
:request_timeout= => nil,
|
64
|
+
:metric_data => nil,
|
65
|
+
:error_data => nil,
|
66
|
+
:transaction_sample_data => nil,
|
67
|
+
:get_agent_commands => []
|
68
|
+
}
|
69
|
+
|
70
|
+
service.stubs(stubbed_method_defaults.merge(stubbed_method_overrides))
|
71
|
+
|
72
|
+
# When session gets called yield to the given block.
|
73
|
+
service.stubs(:session).yields
|
74
|
+
service
|
75
|
+
end
|
57
76
|
|
58
77
|
class Test::Unit::TestCase
|
59
78
|
include Mocha::API
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: newrelic_rpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.6.
|
5
|
-
prerelease:
|
4
|
+
version: 3.5.6.55
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jason Clark
|
@@ -12,8 +12,36 @@ authors:
|
|
12
12
|
- Ben Weintraub
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
|
-
cert_chain:
|
16
|
-
|
15
|
+
cert_chain:
|
16
|
+
- !binary |-
|
17
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURPRENDQWlDZ0F3SUJB
|
18
|
+
Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREJDTVJFd0R3WURWUVFEREFoelpX
|
19
|
+
TjEKY21sMGVURVlNQllHQ2dtU0pvbVQ4aXhrQVJrV0NHNWxkM0psYkdsak1S
|
20
|
+
TXdFUVlLQ1pJbWlaUHlMR1FCR1JZRApZMjl0TUI0WERURXpNREl4TWpFNU1E
|
21
|
+
Y3dOMW9YRFRFME1ESXhNakU1TURjd04xb3dRakVSTUE4R0ExVUVBd3dJCmMy
|
22
|
+
VmpkWEpwZEhreEdEQVdCZ29Ka2lhSmsvSXNaQUVaRmdodVpYZHlaV3hwWXpF
|
23
|
+
VE1CRUdDZ21TSm9tVDhpeGsKQVJrV0EyTnZiVENDQVNJd0RRWUpLb1pJaHZj
|
24
|
+
TkFRRUJCUUFEZ2dFUEFEQ0NBUW9DZ2dFQkFKeVlSdmxrMVhVbwo4SmhXUWNF
|
25
|
+
L3Y2Um1wSy8vSmJlS3ZUS25tV1ZVS3o1b1REU09nL0xLRWh6Q2hwSkpWU09N
|
26
|
+
SkhDeGQ0T294a0lOCnBqUUY1VTJhZjFtNU9OZU4xajRwNE11amJ3TmVxeHNK
|
27
|
+
bWl4R0xLL0JaOXhUbmJwWUFhNnhDUk4xVWZFY3UzTzkKampMSFgzYzYzZ2hs
|
28
|
+
ZHdSQm4vYzJaRDZhbk10RGVxM0M1TUxpeWNGczloN0pYT2EzY1RUSExaa25r
|
29
|
+
WUlvSE1LTgpFRnJpNXpsa3M1MGxiZWFWdkZSbTRJTXJZV1JzRXd6TFpXYU1P
|
30
|
+
eTY4QlZaZTBVbEJCS1NNbnpKZldrYmRSUmNtCnhxdTd2aXU0aHJyQ0dqVW1k
|
31
|
+
SEtubDZ0ZjdCWTd3cVF5S2pqK081RGhheUttS1J1UWNFWDhRVm5zTStheXFp
|
32
|
+
VlUKRXRNaXdOU2NVbnNDQXdFQUFhTTVNRGN3Q1FZRFZSMFRCQUl3QURBZEJn
|
33
|
+
TlZIUTRFRmdRVU9hdWFNc1UwRWxwNgpoaVVpc2o0bDYzWnVuU1V3Q3dZRFZS
|
34
|
+
MFBCQVFEQWdTd01BMEdDU3FHU0liM0RRRUJCUVVBQTRJQkFRQXV3ckhoCmpP
|
35
|
+
aklmQVFvRWJHYWtpd0hUZUltcW1DMUVqQkVXYjErVStyQzJPY3NTUTMrMlEw
|
36
|
+
bUdxMnUzbEFwaEFlTGE2aTUKV1hiNU9kUXFaWTJhSTdOZ014Ukc5OC8rVGNJ
|
37
|
+
bEFUOHREUjBlNi8rUUJsQnVEWFAzWUk1TnVocDVVNExFdmdocgpqRVBhRW8w
|
38
|
+
QUZQYzFKcFNPL3pLbWt0VStlOVZSQUUrcTU1Z0x0aFA4ZmUwdVp2dEdVbjBL
|
39
|
+
Z0RiWEp5T3VHbEhGCko5M045MzdPY3lBMnJEOGdSMXFrcjMvMC93ZTFkd0xa
|
40
|
+
bkw2a040cDhuR3pQZ1haZ09Ic21UZFlaMnJ5WW93dGIKS2M5K3YrUXhuYlpZ
|
41
|
+
cHUySWFQWE92bTNUOEc0TzZxWnZobkxoL1VpZW4rK0RqOGVGQmVjVFBvTThw
|
42
|
+
VmpLM3BoNQpuL0V3dVpDY0U2Z2h0Q0NNCi0tLS0tRU5EIENFUlRJRklDQVRF
|
43
|
+
LS0tLS0K
|
44
|
+
date: 2013-02-13 00:00:00.000000000 Z
|
17
45
|
dependencies: []
|
18
46
|
description: ! 'New Relic is a performance management system, developed by New Relic,
|
19
47
|
|
@@ -58,6 +86,7 @@ files:
|
|
58
86
|
- cert/site.pem
|
59
87
|
- config.dot
|
60
88
|
- config/database.yml
|
89
|
+
- gem-public_cert.pem
|
61
90
|
- init.rb
|
62
91
|
- install.rb
|
63
92
|
- lib/conditional_vendored_dependency_detection.rb
|
@@ -130,6 +159,7 @@ files:
|
|
130
159
|
- lib/new_relic/agent/transaction_sample_builder.rb
|
131
160
|
- lib/new_relic/agent/transaction_sampler.rb
|
132
161
|
- lib/new_relic/agent/worker_loop.rb
|
162
|
+
- lib/new_relic/coerce.rb
|
133
163
|
- lib/new_relic/collection_helper.rb
|
134
164
|
- lib/new_relic/command.rb
|
135
165
|
- lib/new_relic/commands/deployments.rb
|
@@ -213,6 +243,7 @@ files:
|
|
213
243
|
- test/multiverse/suites/agent_only/pipe_manager_test.rb
|
214
244
|
- test/multiverse/suites/agent_only/rum_instrumentation_test.rb
|
215
245
|
- test/multiverse/suites/agent_only/service_timeout_test.rb
|
246
|
+
- test/multiverse/suites/agent_only/ssl_test.rb
|
216
247
|
- test/multiverse/suites/agent_only/start_up_test.rb
|
217
248
|
- test/multiverse/suites/agent_only/test_trace_method_with_punctuation.rb
|
218
249
|
- test/multiverse/suites/agent_only/test_trace_transaction_with_punctuation.rb
|
@@ -244,6 +275,7 @@ files:
|
|
244
275
|
- test/multiverse/suites/resque/resque_setup.rb
|
245
276
|
- test/multiverse/suites/sinatra/Envfile
|
246
277
|
- test/multiverse/suites/sinatra/config/newrelic.yml
|
278
|
+
- test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb
|
247
279
|
- test/multiverse/suites/sinatra/sinatra_metric_explosion_test.rb
|
248
280
|
- test/multiverse/suites/sinatra/sinatra_routes_test.rb
|
249
281
|
- test/multiverse/suites/sinatra/sinatra_test.rb
|
@@ -316,6 +348,7 @@ files:
|
|
316
348
|
- test/new_relic/agent/transaction_sampler_test.rb
|
317
349
|
- test/new_relic/agent/worker_loop_test.rb
|
318
350
|
- test/new_relic/agent_test.rb
|
351
|
+
- test/new_relic/coerce_test.rb
|
319
352
|
- test/new_relic/collection_helper_test.rb
|
320
353
|
- test/new_relic/command/deployments_test.rb
|
321
354
|
- test/new_relic/control/class_methods_test.rb
|
@@ -324,7 +357,6 @@ files:
|
|
324
357
|
- test/new_relic/delayed_job_injection_test.rb
|
325
358
|
- test/new_relic/dispatcher_test.rb
|
326
359
|
- test/new_relic/fake_collector.rb
|
327
|
-
- test/new_relic/fake_service.rb
|
328
360
|
- test/new_relic/fakes_sending_data.rb
|
329
361
|
- test/new_relic/framework_test.rb
|
330
362
|
- test/new_relic/load_test.rb
|
@@ -439,11 +471,37 @@ files:
|
|
439
471
|
homepage: http://www.github.com/newrelic/rpm
|
440
472
|
licenses: []
|
441
473
|
post_install_message: ! "\n# New Relic Ruby Agent Release Notes #\n\n## v3.5.6 ##\n\n
|
442
|
-
\ *
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
474
|
+
\ * Use HTTPS by default\n\n The agent now defaults to using SSL when it communicates
|
475
|
+
with New Relic's\n servers. By defaults already configured, New Relic does not
|
476
|
+
transmit any\n sensitive information (e.g. SQL parameters are masked), but SSL
|
477
|
+
adds \n another layer of security. Upgrading customers may need to remove the\n
|
478
|
+
\ \"ssl: false\" directive from their newrelic.yml to enable ssl. Customers on\n
|
479
|
+
\ Jruby may need to install the jruby-openssl gem to take advantage of this\n
|
480
|
+
\ feature.\n\n * Fix two Resque-related issues\n\n Fixes a possible hang on
|
481
|
+
exit of an instrumented Resque master process\n (https://github.com/defunkt/resque/issues/578),
|
482
|
+
as well as a file descriptor\n leak that could occur during startup of the Resque
|
483
|
+
master process.\n\n * Fix for error graph over 100%\n\n Some errors were double
|
484
|
+
counted toward the overall error total. This\n resulted in graphs with error
|
485
|
+
percentages over 100%. This duplication did\n not impact the specific error traces
|
486
|
+
captured, only the total metric.\n\n * Notice gracefully handled errors in Sinatra\n\n
|
487
|
+
\ When show_exceptions was set to false in Sinatra, errors weren't caught\n by
|
488
|
+
New Relic's error collector. Now handled errors also have the chance\n to get
|
489
|
+
reported back.\n\n * Ruby 2.0 compatibility fixes\n\n Ruby 2.0 no longer finds
|
490
|
+
protected methods by default, but will with a flag.\n http://tenderlovemaking.com/2012/09/07/protected-methods-and-ruby-2-0.html\n\n
|
491
|
+
\ Thanks Ravil Bayramgalin and Charlie Somerville for the fixes.\n\n * Auto-detect
|
492
|
+
Trinidad as dispatcher\n\n Code already existing for detecting Trinidad as a
|
493
|
+
dispatcher, but was only\n accessible via an ENV variable. This now auto-detects
|
494
|
+
on startup. Thanks\n Robert Rasmussen for catching that.\n\n * Coercion of types
|
495
|
+
in collector communication\n\n Certain metrics can be recorded with a Ruby Rational
|
496
|
+
type, which JSON\n serializes as a string rather than a floating point value.
|
497
|
+
We now treat\n coerce each outgoing value, and log issues before sending the
|
498
|
+
data.\n\n * Developer mode fix for chart error\n\n Added require to fix a NameError
|
499
|
+
in developer mode for summary page. Thanks\n to Ryan B. Harvey.\n\n * Don't
|
500
|
+
touch deprecated RAILS_ROOT if on Rails 3\n\n Under some odd startup conditions,
|
501
|
+
we would look for the RAILS_ROOT constant\n after failing to find the ::Rails.root
|
502
|
+
in a Rails 3 app, causing deprecation\n warnings. Thanks for Adrian Irving-Beer
|
503
|
+
for the fix.\n\nSee https://github.com/newrelic/rpm/blob/master/CHANGELOG for a
|
504
|
+
full list of\nchanges.\n"
|
447
505
|
rdoc_options:
|
448
506
|
- --line-numbers
|
449
507
|
- --inline-source
|
metadata.gz.sig
ADDED
Binary file
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require 'ostruct'
|
2
|
-
require File.join(File.dirname(__FILE__), 'fakes_sending_data')
|
3
|
-
|
4
|
-
module NewRelic
|
5
|
-
class FakeService
|
6
|
-
attr_accessor :request_timeout, :agent_id, :agent_data, :collector, :mock
|
7
|
-
|
8
|
-
include FakesSendingData
|
9
|
-
|
10
|
-
def initialize
|
11
|
-
@agent_data = []
|
12
|
-
@supported_methods = [ :connect, :metric_data, :transaction_sample_data,
|
13
|
-
:error_data, :sql_trace_data, :profile_data,
|
14
|
-
:get_agent_commands, :shutdown ]
|
15
|
-
@collector = NewRelic::Control::Server.new(:name => 'fakehost', :port => 0)
|
16
|
-
@id_counter = 0
|
17
|
-
@base_expectations = {
|
18
|
-
'get_redirect_host' => 'localhost',
|
19
|
-
'connect' => { 'agent_run_id' => agent_run_id },
|
20
|
-
'get_agent_commands' => [],
|
21
|
-
'metric_data' => [[{ 'name' => 'Some/Metric/Spec' }, 1]],
|
22
|
-
'sql_trace_data' => nil,
|
23
|
-
'transaction_sample_data' => nil,
|
24
|
-
'error_data' => nil,
|
25
|
-
'shutdown' => nil,
|
26
|
-
}
|
27
|
-
reset
|
28
|
-
end
|
29
|
-
|
30
|
-
def agent_run_id
|
31
|
-
@id_counter += 1
|
32
|
-
end
|
33
|
-
|
34
|
-
def reset
|
35
|
-
@mock = @base_expectations.dup
|
36
|
-
@id_counter = 0
|
37
|
-
@agent_data = []
|
38
|
-
end
|
39
|
-
|
40
|
-
def stub_service(method, value)
|
41
|
-
@mock[method.to_s] = value
|
42
|
-
end
|
43
|
-
|
44
|
-
def method_missing(method, *args)
|
45
|
-
if @supported_methods.include?(method)
|
46
|
-
@agent_data << OpenStruct.new(:action => method, :params => args)
|
47
|
-
@mock[method.to_s]
|
48
|
-
else
|
49
|
-
super
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|