Sha256: bd8339d83befd04d6d972b16b993b09530243bc8eda68377479699f648f13b75

Contents?: true

Size: 1.46 KB

Versions: 11

Compression:

Stored size: 1.46 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'

if NewRelic::Agent::Datastores::Mongo.is_supported_version? &&
    !NewRelic::Agent::Datastores::Mongo.is_monitoring_enabled?
  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

11 entries across 11 versions & 2 rubygems

Version Path
newrelic_rpm-3.16.0.318 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/newrelic_rpm-3.15.2.317/test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.15.2.317 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.15.1.316 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.15.0.314 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.14.3.313 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.14.2.312 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.14.1.311 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.14.0.305 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.13.2.302 test/multiverse/suites/mongo/mongo_instrumentation_test.rb
newrelic_rpm-3.13.1.300 test/multiverse/suites/mongo/mongo_instrumentation_test.rb