Explorar o código

use gauge not inc

Hayden Faulds %!s(int64=8) %!d(string=hai) anos
pai
achega
adc90b68e7

+ 1 - 1
services/web/app/coffee/infrastructure/LockManager.coffee

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

+ 3 - 1
services/web/test/unit/coffee/infrastructure/LockManager/getLockTests.coffee

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