Merge pull request #10747 from overleaf/as-ace-perf-measurement
Add perf measurement of Ace editor GitOrigin-RevId: b33eeac9f7c7f85355a9e8f34833aa94bee2f70a
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user