aboutsummaryrefslogtreecommitdiff
path: root/lib/tooling/base-tool.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tooling/base-tool.js')
-rwxr-xr-xlib/tooling/base-tool.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/tooling/base-tool.js b/lib/tooling/base-tool.js
index 96d21fe70..b31bc2787 100755
--- a/lib/tooling/base-tool.js
+++ b/lib/tooling/base-tool.js
@@ -24,12 +24,19 @@
import path from 'path';
+import PromClient from 'prom-client';
import _ from 'underscore';
import * as exec from '../exec';
import {logger} from '../logger';
import * as utils from '../utils';
+const toolCounter = new PromClient.Counter({
+ name: 'tool_invocations_total',
+ help: 'Number of tool invocations',
+ labelNames: ['language', 'name'],
+});
+
export class BaseTool {
constructor(toolInfo, env) {
this.tool = toolInfo;
@@ -121,6 +128,12 @@ export class BaseTool {
}
async runTool(compilationInfo, inputFilepath, args, stdin /*, supportedLibraries*/) {
+ if (this.tool.name) {
+ toolCounter.inc({
+ language: compilationInfo.compiler.lang,
+ name: this.tool.name,
+ });
+ }
let execOptions = this.getDefaultExecOptions();
if (inputFilepath) execOptions.customCwd = path.dirname(inputFilepath);
execOptions.input = stdin;