|
|
@@ -1,4 +1,6 @@
|
|
|
{db, ObjectId} = require "./mongojs"
|
|
|
+logger = require('logger-sharelatex')
|
|
|
+metrics = require('metrics-sharelatex')
|
|
|
|
|
|
module.exports = ContactManager =
|
|
|
touchContact: (user_id, contact_id, callback = (error) ->) ->
|
|
|
@@ -27,4 +29,16 @@ module.exports = ContactManager =
|
|
|
user_id: user_id
|
|
|
}, (error, user) ->
|
|
|
return callback(error) if error?
|
|
|
- callback null, user?.contacts
|
|
|
+ callback null, user?.contacts
|
|
|
+
|
|
|
+metrics.timeAsyncMethod(
|
|
|
+ ContactManager, 'touchContact',
|
|
|
+ 'ContactManager.touchContact',
|
|
|
+ logger
|
|
|
+)
|
|
|
+
|
|
|
+metrics.timeAsyncMethod(
|
|
|
+ ContactManager, 'getContacts',
|
|
|
+ 'ContactManager.getContacts',
|
|
|
+ logger
|
|
|
+)
|