update to new metrics api

This commit is contained in:
Shane Kilkelly 2017-03-17 15:27:36 +00:00
parent e879f9c742
commit bc37c844ea

View file

@ -72,38 +72,13 @@ module.exports = MongoManager =
}, callback
metrics.timeAsyncMethod(
MongoManager, 'findDoc',
'MongoManager.findDoc',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'getProjectsDocs',
'MongoManager.getProjectsDocs',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'getArchivedProjectDocs',
'MongoManager.getArchivedProjectDocs',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'upsertIntoDocCollection',
'MongoManager.upsertIntoDocCollection',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'markDocAsArchived',
'MongoManager.markDocAsArchived',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'getDocVersion',
'MongoManager.getDocVersion',
logger
)
metrics.timeAsyncMethod(
MongoManager, 'setDocVersion',
'MongoManager.setDocVersion',
logger
)
[
'findDoc',
'getProjectsDocs',
'getArchivedProjectDocs',
'upsertIntoDocCollection',
'markDocAsArchived',
'getDocVersion',
'setDocVersion'
].map (method) ->
metrics.timeAsyncMethod(MongoManager, method, 'mongo.MongoManager', logger)