diff --git a/libraries/metrics/metrics.coffee b/libraries/metrics/metrics.coffee index e641963ddf..c1507c5b11 100644 --- a/libraries/metrics/metrics.coffee +++ b/libraries/metrics/metrics.coffee @@ -6,8 +6,8 @@ name = "unknown" buildKey = (key)-> "#{name}.#{process.env.NODE_ENV or "development"}.#{key}" module.exports = - initialize: (options = {}) -> - name = options.name + initialize: (name) -> + name = name set : (key, value, sampleRate = 1)-> statsd.set buildKey(key), value, sampleRate diff --git a/libraries/metrics/mongodb.coffee b/libraries/metrics/mongodb.coffee index a75e57fd20..c4a2544c84 100644 --- a/libraries/metrics/mongodb.coffee +++ b/libraries/metrics/mongodb.coffee @@ -15,6 +15,10 @@ module.exports = options = {} callback = () -> + if db_command.query? and (db_command.query["ping"] or db_command.query["ismaster"]) + # Ignore noisy methods + return _method.call this, db_command, options, callback + key = "mongo-requests.#{type}" if db_command.query? query = Object.keys(db_command.query).sort().join("_")