Просмотр исходного кода

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

[web] collect timing of empty project creation

GitOrigin-RevId: d85ef149cff021cff7f164a95513a14413a064cf
Jakob Ackermann 4 лет назад
Родитель
Сommit
59429eb3e1
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      services/web/app/src/Features/Project/ProjectCreationHandler.js

+ 4 - 1
services/web/app/src/Features/Project/ProjectCreationHandler.js

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