mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 05:01:17 +00:00
Adapt for metrics v2
This commit is contained in:
parent
5dc2df2a70
commit
d1854c1897
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
Metrics = require "metrics-sharelatex"
|
||||
Metrics.initialize("docstore")
|
||||
Settings = require "settings-sharelatex"
|
||||
logger = require "logger-sharelatex"
|
||||
express = require "express"
|
||||
|
@ -7,7 +8,7 @@ Errors = require "./app/js/Errors"
|
|||
HttpController = require "./app/js/HttpController"
|
||||
Path = require "path"
|
||||
|
||||
Metrics.initialize("docstore")
|
||||
|
||||
logger.initialize("docstore")
|
||||
Metrics.event_loop?.monitor(logger)
|
||||
|
||||
|
@ -15,6 +16,8 @@ app = express()
|
|||
|
||||
app.use Metrics.http.monitor(logger)
|
||||
|
||||
Metrics.injectMetricsRoute(app)
|
||||
|
||||
app.param 'project_id', (req, res, next, project_id) ->
|
||||
if project_id?.match /^[0-9a-f]{24}$/
|
||||
next()
|
||||
|
@ -60,4 +63,4 @@ if !module.parent # Called directly
|
|||
throw error if error?
|
||||
logger.info "Docstore starting up, listening on #{host}:#{port}"
|
||||
|
||||
module.exports = app
|
||||
module.exports = app
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"coffee-script": "^1.12.7",
|
||||
"express": "~4.1.1",
|
||||
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.10",
|
||||
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.12",
|
||||
"mongojs": "2.4.0",
|
||||
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
|
||||
"underscore": "~1.6.0"
|
||||
|
|
Loading…
Reference in a new issue