mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-10 22:50:46 +02:00
[web] Add startup metrics (#25277)
* [web] refactor startup sequence The primary objective here is to call loadGlobalBlobs() only once. But to get there, we need to reorder things and add extra try/catch sections to ensure we are not letting the global uncaughtException handler catch startup errors. Co-authored-by: Antoine Clausse <antoine.clausse@overleaf.com> * [web] add metrics for startup steps Co-authored-by: Antoine Clausse <antoine.clausse@overleaf.com> --------- Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com> GitOrigin-RevId: c73edea02516e919d55b896588dcd1862835fedf
This commit is contained in:
@@ -4,6 +4,7 @@ const { promisify, callbackify } = require('util')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const Views = require('./Views')
|
||||
const _ = require('lodash')
|
||||
const Metrics = require('@overleaf/metrics')
|
||||
|
||||
const MODULE_BASE_PATH = Path.join(__dirname, '/../../../modules')
|
||||
|
||||
@@ -15,7 +16,11 @@ let _viewIncludes = {}
|
||||
|
||||
async function modules() {
|
||||
if (!_modulesLoaded) {
|
||||
const beforeLoadModules = performance.now()
|
||||
await loadModules()
|
||||
Metrics.gauge('web_startup', performance.now() - beforeLoadModules, 1, {
|
||||
path: 'loadModules',
|
||||
})
|
||||
}
|
||||
return _modules
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user