Sha256: c6194421bc763559ec443563e6a81e51fbe09e4935c5ba6ebba41cac72428a19
Contents?: true
Size: 1.28 KB
Versions: 11
Compression:
Stored size: 1.28 KB
Contents
# encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details. require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper') require 'multiverse_helpers' require 'transaction_ignoring_test_cases' class TransactionIgnoringTest < Minitest::Test include MultiverseHelpers include TransactionIgnoringTestCases def trigger_transaction(txn_name) TestWidget.new.run_transaction(txn_name) end def trigger_transaction_with_error(txn_name, error_msg) TestWidget.new.run_transaction(txn_name) do NewRelic::Agent.notice_error(error_msg) end end def trigger_transaction_with_slow_sql(txn_name) TestWidget.new.run_transaction(txn_name) do state = NewRelic::Agent::TransactionState.tl_get NewRelic::Agent.instance.sql_sampler.notice_sql("select * from test", "Database/test/select", nil, 1.5, state) end end class TestWidget include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation def run_transaction(txn_name) NewRelic::Agent.set_transaction_name(txn_name) yield if block_given? end add_transaction_tracer :run_transaction end end
Version data entries
11 entries across 11 versions & 1 rubygems