Add in profiling end point

This commit is contained in:
James Allen 2015-02-03 11:05:23 +00:00
parent 860de1528f
commit 2aa229d145
2 changed files with 10 additions and 0 deletions

View file

@ -107,6 +107,15 @@ 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)

View file

@ -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": {