test/test_helper.rb in newrelic_rpm-3.1.0.djlogging vs test/test_helper.rb in newrelic_rpm-3.1.0.djlogging2

- old
+ new

@@ -121,6 +121,24 @@ sampler.notice_pop_scope "a" sampler.notice_scope_empty sampler.samples[0] end + + def run_sample_trace_on(sampler, path='/path') + sampler.notice_first_scope_push Time.now.to_f + sampler.notice_transaction path, path, {} + sampler.notice_push_scope "Controller/sandwiches/index" + sampler.notice_sql("SELECT * FROM sandwiches WHERE bread = 'wheat'", nil, 0) + sampler.notice_push_scope "ab" + sampler.notice_sql("SELECT * FROM sandwiches WHERE bread = 'white'", nil, 0) + yield sampler if block_given? + sampler.notice_pop_scope "ab" + sampler.notice_push_scope "lew" + sampler.notice_sql("SELECT * FROM sandwiches WHERE bread = 'french'", nil, 0) + sampler.notice_pop_scope "lew" + sampler.notice_pop_scope "Controller/sandwiches/index" + sampler.notice_scope_empty + sampler.samples[0] + end + end