Upgrade metrics

This commit is contained in:
Shane Kilkelly 2017-03-16 16:35:51 +00:00
parent 33df3346f8
commit 54af5fec96
3 changed files with 12 additions and 2 deletions

View file

@ -11,7 +11,6 @@ server = express()
bodyParser = require('body-parser')
metrics = require("metrics-sharelatex")
metrics.initialize("spelling")
metrics.mongodb.monitor(Path.resolve(__dirname + "/node_modules/mongojs/node_modules/mongodb"), logger)
metrics.memory.monitor(logger)
HealthCheckController = require("./app/js/HealthCheckController")

View file

@ -29,4 +29,14 @@ module.exports = LearnedWordsManager =
mongoCache.set(user_token, words)
callback null, words
metrics.timeAsyncMethod(
LearnedWordsManager, 'learnWord',
'LearnedWordsManager.learnWord',
logger
)
metrics.timeAsyncMethod(
LearnedWordsManager, 'getLearnedWords',
'LearnedWordsManager.getLearnedWords',
logger
)

View file

@ -23,6 +23,7 @@ describe "LearnedWordsManager", ->
log:->
err:->
info:->
'metrics-sharelatex': {timeAsyncMethod: sinon.stub(), inc: sinon.stub()}
describe "learnWord", ->
beforeEach ->