Skip to content

Commit

Permalink
Optionally log the compiler cache keys and accesses (#3583)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Apr 27, 2022
1 parent fc001b2 commit 551a0be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions etc/config/compiler-explorer.amazon.properties
Expand Up @@ -20,6 +20,7 @@ pageloadUrl=https://lambda.compiler-explorer.com/pageload
storageSolution=s3
healthCheckFilePath=/efs/.health
showSponsors=true
logCompilerCacheAccesses=true

eventLoopMeasureIntervalMs=50
eventLoopLagThresholdWarn=100
Expand Down
3 changes: 3 additions & 0 deletions lib/base-compiler.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 551a0be

Please sign in to comment.