Optionally log the compiler cache keys and accesses (#3583)

This commit is contained in:
Matt Godbolt
2022-04-27 10:24:04 -05:00
committed by GitHub
parent fc001b2d75
commit 551a0be7ad
2 changed files with 4 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ pageloadUrl=https://lambda.compiler-explorer.com/pageload
storageSolution=s3
healthCheckFilePath=/efs/.health
showSponsors=true
logCompilerCacheAccesses=true
eventLoopMeasureIntervalMs=50
eventLoopLagThresholdWarn=100

View File

@@ -246,6 +246,9 @@ export class BaseCompiler {
const key = this.getCompilerCacheKey(compiler, args, options);
let result = await this.env.compilerCacheGet(key);
if (this.env.ceProps('logCompilerCacheAccesses', false)) {
logger.info(`Cache ${JSON.stringify(key)} ${result ? 'hit' : 'miss'}`);
}
if (!result) {
result = await this.env.enqueue(async () => exec.execute(compiler, args, options));
if (result.okToCache) {