Update app.coffee to work with Metrics v2

This commit is contained in:
Christopher Hoskin 2019-01-08 16:11:56 +00:00
parent 85216fbd34
commit 65e1aba265

View file

@ -1,3 +1,5 @@
Metrics = require "metrics-sharelatex"
Metrics.initialize("track-changes")
Settings = require "settings-sharelatex"
logger = require "logger-sharelatex"
TrackChangesLogger = logger.initialize("track-changes").logger
@ -23,8 +25,7 @@ TrackChangesLogger.addSerializers {
}
Path = require "path"
Metrics = require "metrics-sharelatex"
Metrics.initialize("track-changes")
Metrics.memory.monitor(logger)
child_process = require "child_process"
@ -35,6 +36,8 @@ app = express()
app.use Metrics.http.monitor(logger)
Metrics.injectMetricsRoute(app)
app.post "/project/:project_id/doc/:doc_id/flush", HttpController.flushDoc
app.get "/project/:project_id/doc/:doc_id/diff", HttpController.getDiff