mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
change metrics a bit for promethious
This commit is contained in:
@@ -11,11 +11,11 @@ class ASpellWorker
|
||||
@count = 0
|
||||
@pipe = child_process.spawn("aspell", ["pipe", "-t", "--encoding=utf-8", "-d", language])
|
||||
logger.info process: @pipe.pid, lang: @language, "starting new aspell worker"
|
||||
metrics.inc "aspellWorker-start-" + @language
|
||||
metrics.inc "aspellWorker-start", 1, {method: @language}
|
||||
@pipe.on 'exit', () =>
|
||||
@state = 'killed'
|
||||
logger.info process: @pipe.pid, lang: @language, "aspell worker has exited"
|
||||
metrics.inc "aspellWorker-exit-" + @language
|
||||
metrics.inc "aspellWorker-exit" , 1, {method: @language}
|
||||
@pipe.on 'close', () =>
|
||||
@state = 'closed' unless @state == 'killed'
|
||||
if @callback?
|
||||
|
||||
@@ -17,10 +17,10 @@ module.exports = LearnedWordsManager =
|
||||
getLearnedWords: (user_token, callback = (error, words)->) ->
|
||||
mongoCachedWords = mongoCache.get(user_token)
|
||||
if mongoCachedWords?
|
||||
metrics.inc "mongoCache-hit", 0.1
|
||||
metrics.inc "mongoCache", 0.1, {status: "hit"}
|
||||
return callback(null, mongoCachedWords)
|
||||
|
||||
metrics.inc "mongoCache-miss", 0.1
|
||||
metrics.inc "mongoCache", 0.1, {status: "miss"}
|
||||
logger.info user_token:user_token, "mongoCache miss"
|
||||
|
||||
db.spellingPreferences.findOne token: user_token, (error, preferences) ->
|
||||
|
||||
Reference in New Issue
Block a user