Sha256: 92b514db66808978b8a3c764935843ba08f66506c297816156e2e280c1d23917

Contents?: true

Size: 1.08 KB

Versions: 4

Compression:

Stored size: 1.08 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 File.join(File.dirname(__FILE__), '..', '..', '..', 'agent_helper')

if !NewRelic::Agent::Datastores::Mongo.is_supported_version?

  class NewRelic::Agent::Instrumentation::MongoInstrumentationTest < MiniTest::Unit::TestCase
    include Mongo

    def setup
      @client = Mongo::Connection.new(ENV["MONGO_HOST"], ENV["MONGO_PORT"].to_i)
      @database_name = 'multiverse'
      @database = @client.db(@database_name)
      @collection_name = 'tribbles'
      @collection = @database.collection(@collection_name)

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

      NewRelic::Agent.drop_buffered_data
    end

    def teardown
      NewRelic::Agent.drop_buffered_data
    end

    def test_records_metrics_for_insert
      @collection.insert(@tribble)
      assert_metrics_not_recorded(["Datastore/allWeb", "Datastore/allOther"])
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-3.7.2.190.beta test/multiverse/suites/mongo/mongo_unsupported_version_test.rb
newrelic_rpm-3.7.1.188 test/multiverse/suites/mongo/mongo_unsupported_version_test.rb
newrelic_rpm-3.7.1.182 test/multiverse/suites/mongo/mongo_unsupported_version_test.rb
newrelic_rpm-3.7.1.180 test/multiverse/suites/mongo/mongo_unsupported_version_test.rb