mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Check that req.route.path is set
This commit is contained in:
parent
284d8fb588
commit
1dea55d8f2
1 changed files with 18 additions and 16 deletions
|
@ -8,6 +8,7 @@ module.exports.monitor = (logger) ->
|
|||
res.end = () ->
|
||||
end.apply(this, arguments)
|
||||
responseTime = new Date() - startTime
|
||||
if req.route?.path?
|
||||
routePath = req.route.path.toString().replace(/\//g, '_').replace(/\:/g, '').slice(1)
|
||||
key = "http-requests.#{routePath}.#{req.method}.#{res.statusCode}"
|
||||
|
||||
|
@ -25,5 +26,6 @@ module.exports.monitor = (logger) ->
|
|||
statusCode: res.statusCode
|
||||
"response-time": responseTime
|
||||
"http request"
|
||||
|
||||
next()
|
||||
|
||||
|
|
Loading…
Reference in a new issue