mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
Merge pull request #13091 from overleaf/jpa-metric-blg
[web] add metric for blg file usage GitOrigin-RevId: 5a6bd4185d5f236a56994331cfe3b25c1998d0db
This commit is contained in:
@@ -24,6 +24,22 @@ const Errors = require('../Errors/Errors')
|
||||
|
||||
const VALID_COMPILERS = ['pdflatex', 'latex', 'xelatex', 'lualatex']
|
||||
|
||||
function collectMetricsOnBlgFiles(outputFiles) {
|
||||
let topLevel = 0
|
||||
let nested = 0
|
||||
for (const outputFile of outputFiles) {
|
||||
if (outputFile.type === 'blg') {
|
||||
if (outputFile.path.includes('/')) {
|
||||
nested++
|
||||
} else {
|
||||
topLevel++
|
||||
}
|
||||
}
|
||||
}
|
||||
Metrics.count('blg_output_file', topLevel, 1, { path: 'top-level' })
|
||||
Metrics.count('blg_output_file', nested, 1, { path: 'nested' })
|
||||
}
|
||||
|
||||
const ClsiManager = {
|
||||
sendRequest(projectId, userId, options, callback) {
|
||||
if (options == null) {
|
||||
@@ -265,6 +281,7 @@ const ClsiManager = {
|
||||
projectId,
|
||||
response && response.compile && response.compile.outputFiles
|
||||
)
|
||||
collectMetricsOnBlgFiles(outputFiles)
|
||||
const compile = (response && response.compile) || {}
|
||||
const status = compile.status
|
||||
const stats = compile.stats
|
||||
|
||||
@@ -33,6 +33,7 @@ describe('ClsiManager', function () {
|
||||
}
|
||||
},
|
||||
inc: sinon.stub(),
|
||||
count: sinon.stub(),
|
||||
}
|
||||
this.ClsiManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
|
||||
Reference in New Issue
Block a user