lib/one_apm/inst/nosql/mongo.rb in oneapm_rpm-1.1.3 vs lib/one_apm/inst/nosql/mongo.rb in oneapm_rpm-1.2.0
- old
+ new
@@ -6,22 +6,22 @@
depends_on do
defined?(::Mongo)
end
depends_on do
- require 'one_apm/agent/datastores/mongo'
- OneApm::Agent::Datastores::Mongo.is_supported_version?
+ require 'one_apm/agent/datastore/mongo'
+ OneApm::Agent::Datastore::Mongo.is_supported_version?
end
executes do
OneApm::Manager.logger.info 'Installing Mongo instrumentation'
install_mongo_instrumentation
end
def install_mongo_instrumentation
- require 'one_apm/agent/datastores/mongo/metric_translator'
- require 'one_apm/agent/datastores/mongo/statement_formatter'
+ require 'one_apm/agent/datastore/mongo/metric_translator'
+ require 'one_apm/agent/datastore/mongo/statement_formatter'
hook_instrument_methods
instrument_save
instrument_ensure_index
end
@@ -38,20 +38,20 @@
include OneApm::Support::MethodTracer
# It's key that this method eats all exceptions, as it rests between the
# Mongo operation the user called and us returning them the data. Be safe!
def one_apm_notice_statement(t0, payload, name)
- statement = OneApm::Agent::Datastores::Mongo::StatementFormatter.format(payload, name)
+ statement = OneApm::Agent::Datastore::Mongo::StatementFormatter.format(payload, name)
if statement
OneApm::Manager.agent.transaction_sampler.notice_nosql_statement(statement, (Time.now - t0).to_f)
end
rescue => e
OneApm::Manager.logger.debug("Exception during Mongo statement gathering", e)
end
def one_apm_generate_metrics(operation, payload = nil)
payload ||= { :collection => self.name, :database => self.db.name }
- OneApm::Agent::Datastores::Mongo::MetricTranslator.metrics_for(operation, payload)
+ OneApm::Agent::Datastore::Mongo::MetricTranslator.metrics_for(operation, payload)
end
def instrument_with_one_apm_trace(name, payload = {}, &block)
metrics = one_apm_generate_metrics(name, payload)