Sha256: d569b6b0929934f94dfcbbe6da98ea7c41ce167a353b93c514f0ba1f30e13f23

Contents?: true

Size: 930 Bytes

Versions: 18

Compression:

Stored size: 930 Bytes

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.

module NewRelic
  module Agent
    module Datastores
      module Mongo
        def self.is_supported_version?
          # No version constant in < 2.0 versions of Mongo :(
          defined?(::Mongo) &&
            defined?(::Mongo::MongoClient) &&
            !is_version2?
        end

        # At present we explicitly don't support version 2.x of the driver yet
        def self.is_version2?
          defined?(::Mongo::VERSION) &&
            NewRelic::VersionNumber.new(::Mongo::VERSION) > NewRelic::VersionNumber.new("2.0.0")
        end

        def self.is_version_1_10_or_later?
          # Again, no VERSION constant in 1.x, so we have to rely on constant checks
          defined?(::Mongo::CollectionOperationWriter)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
newrelic_rpm-3.13.0.299 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.12.1.298 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.12.0.288 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.11.2.286 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.11.1.284 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.11.0.283 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.10.0.279 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.9.275 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.8.273 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.7.266 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.6.257 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.5.251 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.4.245 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.3.241 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.2.239 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.1.236 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.9.0.229 lib/new_relic/agent/datastores/mongo.rb
newrelic_rpm-3.8.1.221 lib/new_relic/agent/datastores/mongo.rb