Merge pull request #9491 from overleaf/jpa-time-project-creation

[web] collect timing of empty project creation

GitOrigin-RevId: d85ef149cff021cff7f164a95513a14413a064cf
This commit is contained in:
Jakob Ackermann 2022-09-02 11:57:10 +01:00 committed by Copybot
parent add7eeafaf
commit 59429eb3e1

View file

@ -133,6 +133,7 @@ async function _addExampleProjectFiles(ownerId, projectName, project) {
async function _createBlankProject(ownerId, projectName, attributes = {}) {
metrics.inc('project-creation')
const timer = new metrics.Timer('project-creation')
await ProjectDetailsHandler.promises.validateProjectName(projectName)
if (!attributes.overleaf) {
@ -169,7 +170,9 @@ async function _createBlankProject(ownerId, projectName, attributes = {}) {
project.rootFolder[0] = rootFolder
const user = await User.findById(ownerId, 'ace.spellCheckLanguage')
project.spellCheckLanguage = user.ace.spellCheckLanguage
return await project.save()
await project.save()
timer.done()
return project
}
async function _createRootDoc(project, ownerId, docLines) {