Sha256: 8531ccdfc495baaccaf73c38c138a32c9b250990a1062c57fb822904872a65ed

Contents?: true

Size: 698 Bytes

Versions: 56

Compression:

Stored size: 698 Bytes

Contents

module TestContexts
  def with_running_agent

    context 'with running agent' do # this is needed for the nested setups

      setup do
        @log_data = StringIO.new
        @log = Logger.new(@log_data)
        NewRelic::Agent.manual_start :log => @log
        @agent = NewRelic::Agent.instance
        @agent.transaction_sampler.send :clear_builder
        @agent.transaction_sampler.reset!
        @agent.stats_engine.clear_stats
      end

      yield

      def teardown
        super
        NewRelic::Agent.shutdown
        @log_data.reset
        NewRelic::Control.instance['dispatcher']=nil
        NewRelic::Control.instance['dispatcher_instance_id']=nil
      end

    end
  end
end

Version data entries

56 entries across 56 versions & 4 rubygems

Version Path
newrelic_rpm-3.3.5 test/test_contexts.rb
newrelic_rpm-3.3.5.beta1 test/test_contexts.rb
dolores_rpm-3.3.4.8 test/test_contexts.rb
dolores_rpm-3.3.4.7 test/test_contexts.rb
dolores_rpm-3.3.4.6 test/test_contexts.rb
dolores_rpm-3.3.4.5 test/test_contexts.rb
dolores_rpm-3.3.4.4 test/test_contexts.rb
dolores_rpm-3.3.4.3 test/test_contexts.rb
dolores_rpm-3.3.4.1.fork2 test/test_contexts.rb
dolores_rpm-3.3.4.1.fork test/test_contexts.rb
dolores_rpm-3.2.0.6 test/test_contexts.rb
wd_newrelic_rpm-3.3.4.1 test/test_contexts.rb
dolores_rpm-3.2.0.5 test/test_contexts.rb
dolores_rpm-3.2.0.4 test/test_contexts.rb
dolores_rpm-3.2.0.3 test/test_contexts.rb
dolores_rpm-3.2.0.2 test/test_contexts.rb
dolores_rpm-3.3.4.fork test/test_contexts.rb
newrelic_rpm-3.3.4.1 test/test_contexts.rb
newrelic_rpm-3.3.4 test/test_contexts.rb
newrelic_rpm-3.3.4.beta1 test/test_contexts.rb