Merge pull request #28909 from overleaf/em-compile-metrics

Use histograms to track CLSI compile times

GitOrigin-RevId: cf25f1e6d2094186f419acc70748f0c71b6c3240
This commit is contained in:
Eric Mc Sween
2025-10-10 10:37:25 -04:00
committed by Copybot
parent 2390823a30
commit 74524db293
14 changed files with 239 additions and 151 deletions

View File

@@ -2,6 +2,7 @@ const Path = require('node:path')
const SandboxedModule = require('sandboxed-module')
const { expect } = require('chai')
const sinon = require('sinon')
const Metrics = require('../../../app/js/Metrics')
const MODULE_PATH = require('node:path').join(
__dirname,
@@ -177,6 +178,7 @@ describe('CompileManager', function () {
'./CLSICacheHandler': this.CLSICacheHandler,
'./LatexMetrics': this.LatexMetrics,
'./StatsManager': this.StatsManager,
'./Metrics': Metrics,
},
})
})

View File

@@ -51,7 +51,7 @@ describe('DockerRunner', function () {
},
}),
}),
'./Metrics': {
'@overleaf/metrics': {
Timer: (Timer = class Timer {
done() {}
}),

View File

@@ -27,7 +27,7 @@ describe('OutputFileOptimiser', function () {
fs: (this.fs = {}),
path: (this.Path = {}),
child_process: { spawn: (this.spawn = sinon.stub()) },
'./Metrics': {},
'@overleaf/metrics': {},
},
globals: { Math }, // used by lodash
})

View File

@@ -34,7 +34,7 @@ describe('ResourceWriter', function () {
createProjectDir: sinon.stub().yields(),
}),
'./OutputFileFinder': (this.OutputFileFinder = {}),
'./Metrics': (this.Metrics = {
'@overleaf/metrics': (this.Metrics = {
inc: sinon.stub(),
Timer: (Timer = (function () {
Timer = class Timer {