mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-11 18:50:56 +00:00
Add in profiling end point
This commit is contained in:
parent
860de1528f
commit
2aa229d145
2 changed files with 10 additions and 0 deletions
|
@ -106,6 +106,15 @@ app.use (req, res, next) ->
|
|||
app.get "/status", (req, res)->
|
||||
res.send("web sharelatex is alive")
|
||||
req.session.destroy()
|
||||
|
||||
profiler = require "v8-profiler"
|
||||
app.get "/profile", (req, res) ->
|
||||
time = parseInt(req.query.time || "1000")
|
||||
profiler.startProfiling("test")
|
||||
setTimeout () ->
|
||||
profile = profiler.stopProfiling("test")
|
||||
res.json(profile)
|
||||
, time
|
||||
|
||||
logger.info ("creating HTTP server").yellow
|
||||
server = require('http').createServer(app)
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
"translations-sharelatex": "git+https://github.com/sharelatex/translations-sharelatex.git#master",
|
||||
"underscore": "1.6.0",
|
||||
"underscore.string": "^3.0.2",
|
||||
"v8-profiler": "^5.2.3",
|
||||
"xml2js": "0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in a new issue