use gauge not inc

This commit is contained in:
Hayden Faulds 2018-02-21 13:17:51 +00:00
parent 584cd71173
commit adc90b68e7
2 changed files with 4 additions and 2 deletions

View file

@ -62,7 +62,7 @@ module.exports = LockManager =
LockManager._tryLock key, namespace, (error, gotLock) ->
return callback(error) if error?
if gotLock
metrics.inc "lock.#{namespace}.get.success.tries", attempts
metrics.gauge "lock.#{namespace}.get.success.tries", attempts
callback(null)
else
setTimeout attempt, LockManager.LOCK_TEST_INTERVAL

View file

@ -13,7 +13,9 @@ describe 'LockManager - getting the lock', ->
client: ()->
auth:->
"settings-sharelatex":{redis:{}}
"metrics-sharelatex": inc:->
"metrics-sharelatex":
inc:->
gauge:->
@callback = sinon.stub()
@key = "lock:web:lockName:project-id}"