Merge pull request #10747 from overleaf/as-ace-perf-measurement

Add perf measurement of Ace editor

GitOrigin-RevId: b33eeac9f7c7f85355a9e8f34833aa94bee2f70a
This commit is contained in:
Tim Down
2022-12-07 09:04:21 +00:00
committed by Copybot
parent fde8ab422b
commit fd2863bf7a
4 changed files with 190 additions and 0 deletions
+22
View File
@@ -68,6 +68,7 @@ import './features/source-editor/controllers/cm6-switch-away-survey-controller'
import './features/source-editor/controllers/grammarly-warning-controller'
import { cleanupServiceWorker } from './utils/service-worker-cleanup'
import { reportCM6Perf } from './infrastructure/cm6-performance'
import { reportAcePerf } from './ide/editor/ace-performance'
App.controller(
'IdeController',
@@ -299,6 +300,27 @@ If the project has been renamed please look in your project list for a new proje
}
}
}
} else if (editorType === 'ace') {
const acePerfData = reportAcePerf()
if (acePerfData.numberOfEntries > 0) {
const perfProps = [
'NumberOfEntries',
'MeanKeypressPaint',
'Grammarly',
'SessionLength',
'Memory',
'Release',
]
for (const prop of perfProps) {
const perfValue =
acePerfData[prop.charAt(0).toLowerCase() + prop.slice(1)]
if (perfValue !== null) {
segmentation['acePerf' + prop] = perfValue
}
}
}
}
return segmentation