[clsi] prepare for clsi-cache survey (#29274)

* [clsi] add stats and timings to compile response from clsi-cache

* [clsi] set downloadedFromCache when previously downloaded for synctex

Assumption: every compile will emit an output.log. When the output.log
is missing, but the output.synctex.gz exists, it must have been
downloaded from the cache.
GitOrigin-RevId: 41ea34880931e3c43dda3bc9eb26c0d02054894d
This commit is contained in:
Jakob Ackermann
2025-10-23 08:05:43 +00:00
committed by Copybot
parent a0ad073785
commit 02391c6c51
5 changed files with 31 additions and 1 deletions
@@ -123,6 +123,8 @@ async function getLatestBuildFromCache(req, res) {
clsiServerId,
clsiCacheShard,
options,
stats,
timings,
} = await ClsiCacheManager.getLatestCompileResult(projectId, userId)
let { pdfCachingMinChunkSize, pdfDownloadDomain } =
@@ -138,6 +140,8 @@ async function getLatestBuildFromCache(req, res) {
pdfDownloadDomain,
pdfCachingMinChunkSize,
options,
stats,
timings,
})
} catch (err) {
if (err instanceof NotFoundError) {
@@ -107,7 +107,16 @@ async function tryGetLatestCompileResult(projectId, userId, signal) {
const [, editorId, buildId] = metaLocation.match(
/\/build\/([a-f0-9-]+?)-([a-f0-9]+-[a-f0-9]+)\//
)
const { ranges, contentId, clsiServerId, compileGroup, size, options } = meta
const {
ranges,
contentId,
clsiServerId,
compileGroup,
size,
options,
stats,
timings,
} = meta
let baseURL = `/project/${projectId}`
if (userId) {
@@ -150,6 +159,8 @@ async function tryGetLatestCompileResult(projectId, userId, signal) {
clsiServerId,
clsiCacheShard,
options,
stats,
timings,
}
}