mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
Temporarily collect metrics on job time and queue time (#4790)
Collecting raw data points for job time and queue time for a few days. Briefly discussed with Matt, will be reverting in a few days.
This commit is contained in:
@@ -334,7 +334,7 @@ export class BaseCompiler implements ICompiler {
|
||||
const key = this.getCompilerCacheKey(compiler, args, options);
|
||||
let result = await this.env.compilerCacheGet(key as any);
|
||||
if (!result) {
|
||||
result = await this.env.enqueue(async () => await exec.execute(compiler, args, options));
|
||||
result = await this.env.enqueue(async () => await exec.execute(compiler, args, options), true);
|
||||
if (result.okToCache) {
|
||||
this.env
|
||||
.compilerCachePut(key as any, result, undefined)
|
||||
|
||||
@@ -151,8 +151,21 @@ export class CompilationEnvironment {
|
||||
return this.executableCache.put(key, fs.readFileSync(filepath));
|
||||
}
|
||||
|
||||
enqueue<T>(job: Job<T>) {
|
||||
return this.compilationQueue.enqueue(job);
|
||||
enqueue<T>(job: Job<T>, silent?: boolean) {
|
||||
const enqueue_time = performance.now();
|
||||
return this.compilationQueue.enqueue(async () => {
|
||||
const launch_time = performance.now();
|
||||
const res = await job();
|
||||
const finish_time = performance.now();
|
||||
if (!silent) {
|
||||
logger.info(
|
||||
`(compilation wall clock time: ${Math.round(finish_time - launch_time)} ms, queue time: ${
|
||||
launch_time - enqueue_time
|
||||
} ms)`,
|
||||
);
|
||||
}
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
findBadOptions(options: string[]) {
|
||||
|
||||
Reference in New Issue
Block a user