Sha256: 0aadca7c3e9b7e9261575444832a4468cb7f899d368bb14cf632307804117c69

Contents?: true

Size: 1.47 KB

Versions: 15

Compression:

Stored size: 1.47 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 'mongo'
require 'newrelic_rpm'
require 'new_relic/agent/datastores/mongo'
require 'securerandom'
require File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper')

if NewRelic::Agent::Datastores::Mongo.is_supported_version?
  require File.join(File.dirname(__FILE__), '..', '..', '..', 'helpers', 'mongo_metric_builder')
  require File.join(File.dirname(__FILE__), 'helpers', 'mongo_server')
  require File.join(File.dirname(__FILE__), 'helpers', 'mongo_replica_set')
  require File.join(File.dirname(__FILE__), 'helpers', 'mongo_operation_tests')

  class NewRelic::Agent::Instrumentation::MongoInstrumentationTest < Minitest::Test
    include Mongo
    include ::NewRelic::TestHelpers::MongoMetricBuilder
    include ::MongoOperationTests

    def setup
      @client = Mongo::MongoClient.new($mongo.host, $mongo.port)
      @database_name = "multiverse"
      @database = @client.db(@database_name)
      @collection_name = "tribbles-#{SecureRandom.hex(16)}"
      @collection = @database.collection(@collection_name)

      @tribble = {'name' => 'soterios johnson'}

      NewRelic::Agent::Transaction.stubs(:recording_web_transaction?).returns(true)
      NewRelic::Agent.drop_buffered_data
    end

    def teardown
      NewRelic::Agent.drop_buffered_data
      @database.drop_collection(@collection_name)
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
newrelic_rpm-3.10.0.279 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.9.275 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.8.273 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.7.266 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.6.257 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.5.251 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.4.245 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.3.241 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.2.239 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.1.236 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.9.0.229 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.8.1.221 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.8.0.218 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.7.3.204 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.7.3.199 test/multiverse/suites/mongo/mongo_instrumentation_test.rb