mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Send unique users to perfmon
This commit is contained in:
parent
0a1e20f971
commit
abfce4299c
1 changed files with 3 additions and 2 deletions
|
@ -25,7 +25,8 @@ exports.middleware = (req, res, next) ->
|
|||
path = req.route?.path or '/*'
|
||||
stat = req.method + "." + path.replace /[^A-Za-z0-9]+/g, '_'
|
||||
realClient.timing stat, ms
|
||||
|
||||
name = req.user?._id
|
||||
realClient.unique 'users', name if name
|
||||
|
||||
res.once 'finish', recordMetrics
|
||||
res.once 'error', cleanup
|
||||
|
@ -39,5 +40,5 @@ exports.trace = (name, callback) ->
|
|||
return callback unless realClient
|
||||
time = process.hrtime()
|
||||
(args...) ->
|
||||
realClient.timing name, ms
|
||||
realClient.timing name.replace(/[^A-Za-z0-9]+/g, '_'), ms
|
||||
return callback.apply(this, args)
|
Loading…
Reference in a new issue