aboutsummaryrefslogtreecommitdiff
path: root/lib/base-compiler.ts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base-compiler.ts')
-rw-r--r--lib/base-compiler.ts18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/base-compiler.ts b/lib/base-compiler.ts
index a1c79a018..020dc84fa 100644
--- a/lib/base-compiler.ts
+++ b/lib/base-compiler.ts
@@ -25,6 +25,7 @@
import path from 'path';
import fs from 'fs-extra';
+import * as PromClient from 'prom-client';
import temp from 'temp';
import _ from 'underscore';
@@ -59,7 +60,6 @@ import {AsmParser} from './parsers/asm-parser';
import {IAsmParser} from './parsers/asm-parser.interfaces';
import {getToolchainPath} from './toolchain-utils';
import * as utils from './utils';
-import * as PromClient from 'prom-client';
export class BaseCompiler {
public compiler: any;
@@ -87,7 +87,11 @@ export class BaseCompiler {
protected externalparser: null | ExternalParserBase;
protected supportedLibraries?: Record<string, Library>;
protected packager: Packager;
- private static objdumpAndParseGauge?;
+ private static objdumpAndParseCounter = new PromClient.Counter({
+ name: 'ce_objdumpandparsetime_total',
+ help: 'Time spent on objdump and parsing of objdumps',
+ labelNames: [],
+ });
constructor(compilerInfo, env) {
// Information about our compiler
@@ -97,14 +101,6 @@ export class BaseCompiler {
throw new Error(`Missing language info for ${compilerInfo.lang}`);
}
- if (!BaseCompiler.objdumpAndParseGauge) {
- BaseCompiler.objdumpAndParseGauge = new PromClient.Counter({
- name: 'ce_objdumpandparsetime_total',
- help: 'Time spent on objdump and parsing of objdumps',
- labelNames: [],
- });
- }
-
this.compileFilename = `example${this.lang.extensions[0]}`;
this.env = env;
// Partial application of compilerProps with the proper language id applied to it
@@ -2076,7 +2072,7 @@ export class BaseCompiler {
result.filteredCount = res.filteredCount;
if (result.objdumpTime) {
const dumpAndParseTime = parseInt(result.objdumpTime) + parseInt(result.parsingTime);
- BaseCompiler.objdumpAndParseGauge.inc(dumpAndParseTime);
+ BaseCompiler.objdumpAndParseCounter.inc(dumpAndParseTime);
}
} else {
result.asm = [{text: result.asm}];