From 125790b6049f71801e6265f636000ce789ec6292 Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 6 May 2014 17:19:04 +0100 Subject: [PATCH] Ignore all queries --- libraries/metrics/mongodb.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/metrics/mongodb.coffee b/libraries/metrics/mongodb.coffee index b33f6a3f85..cf8710ccf9 100644 --- a/libraries/metrics/mongodb.coffee +++ b/libraries/metrics/mongodb.coffee @@ -15,8 +15,9 @@ module.exports = options = {} callback = () -> - if db_command.query? and (db_command.query["ping"] or db_command.query["ismaster"]) - # Ignore noisy methods + collection = db_command.collectionName + if collection.match(/\$cmd$/) + # Ignore noisy command methods like authenticating, ismaster and ping return _method.call this, db_command, options, callback key = "mongo-requests.#{type}" @@ -32,7 +33,7 @@ module.exports = logger.log query: db_command.query type: type - collection: db_command.collectionName + collection: collection "response-time": new Date() - start "mongo request" callback.apply this, arguments