@theia/plugin-metrics 1.67.0-next.56 → 1.67.0-next.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/plugin-metrics-creator.d.ts +68 -0
- package/lib/browser/plugin-metrics-creator.d.ts.map +1 -0
- package/lib/browser/plugin-metrics-creator.js +178 -0
- package/lib/browser/plugin-metrics-creator.js.map +1 -0
- package/lib/browser/plugin-metrics-frontend-module.d.ts +4 -0
- package/lib/browser/plugin-metrics-frontend-module.d.ts.map +1 -0
- package/lib/browser/plugin-metrics-frontend-module.js +37 -0
- package/lib/browser/plugin-metrics-frontend-module.js.map +1 -0
- package/lib/browser/plugin-metrics-languages-main.d.ts +59 -0
- package/lib/browser/plugin-metrics-languages-main.d.ts.map +1 -0
- package/lib/browser/plugin-metrics-languages-main.js +204 -0
- package/lib/browser/plugin-metrics-languages-main.js.map +1 -0
- package/lib/browser/plugin-metrics-output-registry.d.ts +8 -0
- package/lib/browser/plugin-metrics-output-registry.d.ts.map +1 -0
- package/lib/browser/plugin-metrics-output-registry.js +41 -0
- package/lib/browser/plugin-metrics-output-registry.js.map +1 -0
- package/lib/browser/plugin-metrics-resolver.d.ts +18 -0
- package/lib/browser/plugin-metrics-resolver.d.ts.map +1 -0
- package/lib/browser/plugin-metrics-resolver.js +62 -0
- package/lib/browser/plugin-metrics-resolver.js.map +1 -0
- package/lib/common/metrics-protocol.d.ts +11 -0
- package/lib/common/metrics-protocol.d.ts.map +1 -0
- package/lib/common/metrics-protocol.js +25 -0
- package/lib/common/metrics-protocol.js.map +1 -0
- package/lib/common/plugin-metrics-types.d.ts +28 -0
- package/lib/common/plugin-metrics-types.d.ts.map +1 -0
- package/lib/common/plugin-metrics-types.js +57 -0
- package/lib/common/plugin-metrics-types.js.map +1 -0
- package/lib/node/metric-output/plugin-metrics-time-count.d.ts +6 -0
- package/lib/node/metric-output/plugin-metrics-time-count.d.ts.map +1 -0
- package/lib/node/metric-output/plugin-metrics-time-count.js +39 -0
- package/lib/node/metric-output/plugin-metrics-time-count.js.map +1 -0
- package/lib/node/metric-output/plugin-metrics-time-sum.d.ts +6 -0
- package/lib/node/metric-output/plugin-metrics-time-sum.d.ts.map +1 -0
- package/lib/node/metric-output/plugin-metrics-time-sum.js +37 -0
- package/lib/node/metric-output/plugin-metrics-time-sum.js.map +1 -0
- package/lib/node/metric-string-generator.d.ts +7 -0
- package/lib/node/metric-string-generator.d.ts.map +1 -0
- package/lib/node/metric-string-generator.js +71 -0
- package/lib/node/metric-string-generator.js.map +1 -0
- package/lib/node/metrics-contributor.d.ts +7 -0
- package/lib/node/metrics-contributor.d.ts.map +1 -0
- package/lib/node/metrics-contributor.js +72 -0
- package/lib/node/metrics-contributor.js.map +1 -0
- package/lib/node/metrics-contributor.spec.d.ts +2 -0
- package/lib/node/metrics-contributor.spec.d.ts.map +1 -0
- package/lib/node/metrics-contributor.spec.js +204 -0
- package/lib/node/metrics-contributor.spec.js.map +1 -0
- package/lib/node/plugin-metrics-backend-module.d.ts +4 -0
- package/lib/node/plugin-metrics-backend-module.d.ts.map +1 -0
- package/lib/node/plugin-metrics-backend-module.js +48 -0
- package/lib/node/plugin-metrics-backend-module.js.map +1 -0
- package/lib/node/plugin-metrics-impl.d.ts +11 -0
- package/lib/node/plugin-metrics-impl.d.ts.map +1 -0
- package/lib/node/plugin-metrics-impl.js +41 -0
- package/lib/node/plugin-metrics-impl.js.map +1 -0
- package/lib/node/plugin-metrics.d.ts +11 -0
- package/lib/node/plugin-metrics.d.ts.map +1 -0
- package/lib/node/plugin-metrics.js +47 -0
- package/lib/node/plugin-metrics.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OutputChannelRegistryMainImpl } from '@theia/plugin-ext/lib/main/browser/output-channel-registry-main';
|
|
2
|
+
import { PluginMetricsCreator } from './plugin-metrics-creator';
|
|
3
|
+
import { PluginInfo } from '@theia/plugin-ext/lib/common/plugin-api-rpc';
|
|
4
|
+
export declare class PluginMetricsOutputChannelRegistry extends OutputChannelRegistryMainImpl {
|
|
5
|
+
protected readonly pluginMetricsCreator: PluginMetricsCreator;
|
|
6
|
+
$append(channelName: string, errorOrValue: string, pluginInfo: PluginInfo): PromiseLike<void>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=plugin-metrics-output-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-output-registry.d.ts","sourceRoot":"","sources":["../../src/browser/plugin-metrics-output-registry.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,qBACa,kCAAmC,SAAQ,6BAA6B;IAGjF,SAAS,CAAC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAErD,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC;CAQzG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PluginMetricsOutputChannelRegistry = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
const output_channel_registry_main_1 = require("@theia/plugin-ext/lib/main/browser/output-channel-registry-main");
|
|
22
|
+
const plugin_metrics_creator_1 = require("./plugin-metrics-creator");
|
|
23
|
+
const plugin_metrics_types_1 = require("../common/plugin-metrics-types");
|
|
24
|
+
let PluginMetricsOutputChannelRegistry = class PluginMetricsOutputChannelRegistry extends output_channel_registry_main_1.OutputChannelRegistryMainImpl {
|
|
25
|
+
$append(channelName, errorOrValue, pluginInfo) {
|
|
26
|
+
if (errorOrValue.startsWith('[Error')) {
|
|
27
|
+
const createdMetric = (0, plugin_metrics_types_1.createDefaultRequestData)(pluginInfo.id, errorOrValue);
|
|
28
|
+
this.pluginMetricsCreator.createErrorMetric(createdMetric);
|
|
29
|
+
}
|
|
30
|
+
return super.$append(channelName, errorOrValue, pluginInfo);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.PluginMetricsOutputChannelRegistry = PluginMetricsOutputChannelRegistry;
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, inversify_1.inject)(plugin_metrics_creator_1.PluginMetricsCreator),
|
|
36
|
+
tslib_1.__metadata("design:type", plugin_metrics_creator_1.PluginMetricsCreator)
|
|
37
|
+
], PluginMetricsOutputChannelRegistry.prototype, "pluginMetricsCreator", void 0);
|
|
38
|
+
exports.PluginMetricsOutputChannelRegistry = PluginMetricsOutputChannelRegistry = tslib_1.__decorate([
|
|
39
|
+
(0, inversify_1.injectable)()
|
|
40
|
+
], PluginMetricsOutputChannelRegistry);
|
|
41
|
+
//# sourceMappingURL=plugin-metrics-output-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-output-registry.js","sourceRoot":"","sources":["../../src/browser/plugin-metrics-output-registry.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAkE;AAClE,kHAAgH;AAChH,qEAAgE;AAChE,yEAA0E;AAInE,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,4DAA6B;IAKxE,OAAO,CAAC,WAAmB,EAAE,YAAoB,EAAE,UAAsB;QAC9E,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,MAAM,aAAa,GAAG,IAAA,+CAAwB,EAAC,UAAU,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC;YAC5E,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;IAChE,CAAC;CAEJ,CAAA;AAbY,gFAAkC;AAGxB;IADlB,IAAA,kBAAM,EAAC,6CAAoB,CAAC;sCACY,6CAAoB;gFAAC;6CAHrD,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;GACA,kCAAkC,CAa9C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This class helps resolve language server requests into successes or failures
|
|
3
|
+
* and sends the data to the metricsExtractor
|
|
4
|
+
*/
|
|
5
|
+
export declare class PluginMetricsResolver {
|
|
6
|
+
private metricsCreator;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a request for pluginID and create a metric based on whether or not
|
|
9
|
+
* the language server errored.
|
|
10
|
+
*
|
|
11
|
+
* @param pluginID the ID of the plugin that made the request
|
|
12
|
+
* @param method the method that was request
|
|
13
|
+
* @param request the result of the language server request
|
|
14
|
+
*/
|
|
15
|
+
resolveRequest(pluginID: string, method: string, request: PromiseLike<any> | Promise<any> | Thenable<any> | any): Promise<any>;
|
|
16
|
+
private createAndSetMetric;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=plugin-metrics-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-resolver.d.ts","sourceRoot":"","sources":["../../src/browser/plugin-metrics-resolver.ts"],"names":[],"mappings":"AAsBA;;;GAGG;AACH,qBACa,qBAAqB;IAG9B,OAAO,CAAC,cAAc,CAAuB;IAE7C;;;;;;;OAOG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAYpI,OAAO,CAAC,kBAAkB;CAI7B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PluginMetricsResolver = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
21
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
+
const plugin_metrics_creator_1 = require("./plugin-metrics-creator");
|
|
23
|
+
const plugin_metrics_types_1 = require("../common/plugin-metrics-types");
|
|
24
|
+
/**
|
|
25
|
+
* This class helps resolve language server requests into successes or failures
|
|
26
|
+
* and sends the data to the metricsExtractor
|
|
27
|
+
*/
|
|
28
|
+
let PluginMetricsResolver = class PluginMetricsResolver {
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a request for pluginID and create a metric based on whether or not
|
|
31
|
+
* the language server errored.
|
|
32
|
+
*
|
|
33
|
+
* @param pluginID the ID of the plugin that made the request
|
|
34
|
+
* @param method the method that was request
|
|
35
|
+
* @param request the result of the language server request
|
|
36
|
+
*/
|
|
37
|
+
async resolveRequest(pluginID, method, request) {
|
|
38
|
+
const currentTime = performance.now();
|
|
39
|
+
try {
|
|
40
|
+
const value = await request;
|
|
41
|
+
this.createAndSetMetric(pluginID, method, performance.now() - currentTime, true);
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
this.createAndSetMetric(pluginID, method, performance.now() - currentTime, false);
|
|
46
|
+
return Promise.reject(error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
createAndSetMetric(pluginID, method, time, successful) {
|
|
50
|
+
const createdSuccessMetric = (0, plugin_metrics_types_1.createRequestData)(pluginID, method, time);
|
|
51
|
+
this.metricsCreator.createMetric(createdSuccessMetric, successful);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
exports.PluginMetricsResolver = PluginMetricsResolver;
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, inversify_1.inject)(plugin_metrics_creator_1.PluginMetricsCreator),
|
|
57
|
+
tslib_1.__metadata("design:type", plugin_metrics_creator_1.PluginMetricsCreator)
|
|
58
|
+
], PluginMetricsResolver.prototype, "metricsCreator", void 0);
|
|
59
|
+
exports.PluginMetricsResolver = PluginMetricsResolver = tslib_1.__decorate([
|
|
60
|
+
(0, inversify_1.injectable)()
|
|
61
|
+
], PluginMetricsResolver);
|
|
62
|
+
//# sourceMappingURL=plugin-metrics-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-resolver.js","sourceRoot":"","sources":["../../src/browser/plugin-metrics-resolver.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,uDAAuD;AAEvD,4DAAkE;AAClE,qEAAgE;AAChE,yEAAmE;AAEnE;;;GAGG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAK9B;;;;;;;OAOG;IACH,KAAK,CAAC,cAAc,CAAC,QAAgB,EAAE,MAAc,EAAE,OAA8D;QACjH,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACtC,IAAI,CAAC;YACD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC;YAC5B,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,EAAE,IAAI,CAAC,CAAC;YACjF,OAAO,KAAK,CAAC;QACjB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,WAAW,EAAE,KAAK,CAAC,CAAC;YAClF,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;IACL,CAAC;IAEO,kBAAkB,CAAC,QAAgB,EAAE,MAAc,EAAE,IAAY,EAAE,UAAmB;QAC1F,MAAM,oBAAoB,GAAG,IAAA,wCAAiB,EAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;IACvE,CAAC;CACJ,CAAA;AA7BY,sDAAqB;AAGtB;IADP,IAAA,kBAAM,EAAC,6CAAoB,CAAC;sCACL,6CAAoB;6DAAC;gCAHpC,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CA6BjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JSON-RPC interface for plugin metrics
|
|
3
|
+
*/
|
|
4
|
+
export declare const metricsJsonRpcPath = "/services/plugin-ext/metrics";
|
|
5
|
+
export declare const PluginMetrics: unique symbol;
|
|
6
|
+
export interface PluginMetrics {
|
|
7
|
+
setMetrics(metrics: string): void;
|
|
8
|
+
getMetrics(): string;
|
|
9
|
+
}
|
|
10
|
+
export declare const METRICS_TIMEOUT = 10000;
|
|
11
|
+
//# sourceMappingURL=metrics-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-protocol.d.ts","sourceRoot":"","sources":["../../src/common/metrics-protocol.ts"],"names":[],"mappings":"AAgBA;;GAEG;AACH,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,MAAM,WAAW,aAAa;IAC1B,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,IAAI,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.METRICS_TIMEOUT = exports.PluginMetrics = exports.metricsJsonRpcPath = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* The JSON-RPC interface for plugin metrics
|
|
21
|
+
*/
|
|
22
|
+
exports.metricsJsonRpcPath = '/services/plugin-ext/metrics';
|
|
23
|
+
exports.PluginMetrics = Symbol('PluginMetrics');
|
|
24
|
+
exports.METRICS_TIMEOUT = 10000;
|
|
25
|
+
//# sourceMappingURL=metrics-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-protocol.js","sourceRoot":"","sources":["../../src/common/metrics-protocol.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF;;GAEG;AACU,QAAA,kBAAkB,GAAG,8BAA8B,CAAC;AACpD,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAMxC,QAAA,eAAe,GAAG,KAAK,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface MetricsMap {
|
|
2
|
+
[extensionID: string]: MethodToAnalytics;
|
|
3
|
+
}
|
|
4
|
+
export interface MethodToAnalytics {
|
|
5
|
+
[methodID: string]: AnalyticsFromRequests;
|
|
6
|
+
}
|
|
7
|
+
export interface AnalyticsFromRequests {
|
|
8
|
+
totalRequests: number;
|
|
9
|
+
successfulResponses: number;
|
|
10
|
+
sumOfTimeForSuccess: number;
|
|
11
|
+
sumOfTimeForFailure: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DataFromRequest {
|
|
14
|
+
pluginID: string;
|
|
15
|
+
errorContentsOrMethod: string;
|
|
16
|
+
timeTaken: number;
|
|
17
|
+
}
|
|
18
|
+
export interface MetricOutput {
|
|
19
|
+
header: string;
|
|
20
|
+
createMetricOutput(pluginID: string, method: string, requestAnalytics: AnalyticsFromRequests): string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Helper functions for creating an object that corresponds to the DataFromRequest interface
|
|
24
|
+
*/
|
|
25
|
+
export declare function createRequestData(pluginID: string, errorContentsOrMethod: string, timeTaken: number): DataFromRequest;
|
|
26
|
+
export declare function createDefaultRequestData(pluginID: string, errorContentsOrMethod: string): DataFromRequest;
|
|
27
|
+
export declare function createDefaultAnalytics(timeTaken: number, isRequestSuccessful: boolean): AnalyticsFromRequests;
|
|
28
|
+
//# sourceMappingURL=plugin-metrics-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-types.d.ts","sourceRoot":"","sources":["../../src/common/plugin-metrics-types.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,UAAU;IACvB,CAAC,WAAW,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAC3C;AAED,MAAM,WAAW,iBAAiB;IAC9B,CAAC,QAAQ,EAAE,MAAM,GAAG,qBAAqB,CAAC;CAC7C;AAED,MAAM,WAAW,qBAAqB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,MAAM,CAAC;CACzG;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,eAAe,CAMrH;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,GAAG,eAAe,CAMzG;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB,EAAE,OAAO,GAAG,qBAAqB,CAgB7G"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.createDefaultAnalytics = exports.createDefaultRequestData = exports.createRequestData = void 0;
|
|
19
|
+
/**
|
|
20
|
+
* Helper functions for creating an object that corresponds to the DataFromRequest interface
|
|
21
|
+
*/
|
|
22
|
+
function createRequestData(pluginID, errorContentsOrMethod, timeTaken) {
|
|
23
|
+
return {
|
|
24
|
+
pluginID,
|
|
25
|
+
errorContentsOrMethod,
|
|
26
|
+
timeTaken
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
exports.createRequestData = createRequestData;
|
|
30
|
+
function createDefaultRequestData(pluginID, errorContentsOrMethod) {
|
|
31
|
+
return {
|
|
32
|
+
pluginID,
|
|
33
|
+
errorContentsOrMethod,
|
|
34
|
+
timeTaken: 0
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.createDefaultRequestData = createDefaultRequestData;
|
|
38
|
+
function createDefaultAnalytics(timeTaken, isRequestSuccessful) {
|
|
39
|
+
if (isRequestSuccessful) {
|
|
40
|
+
return {
|
|
41
|
+
sumOfTimeForSuccess: timeTaken,
|
|
42
|
+
sumOfTimeForFailure: 0,
|
|
43
|
+
successfulResponses: 0,
|
|
44
|
+
totalRequests: 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
return {
|
|
49
|
+
sumOfTimeForSuccess: 0,
|
|
50
|
+
sumOfTimeForFailure: timeTaken,
|
|
51
|
+
successfulResponses: 0,
|
|
52
|
+
totalRequests: 0
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.createDefaultAnalytics = createDefaultAnalytics;
|
|
57
|
+
//# sourceMappingURL=plugin-metrics-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-types.js","sourceRoot":"","sources":["../../src/common/plugin-metrics-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AA8BhF;;GAEG;AACH,SAAgB,iBAAiB,CAAC,QAAgB,EAAE,qBAA6B,EAAE,SAAiB;IAChG,OAAO;QACH,QAAQ;QACR,qBAAqB;QACrB,SAAS;KACZ,CAAC;AACN,CAAC;AAND,8CAMC;AAED,SAAgB,wBAAwB,CAAC,QAAgB,EAAE,qBAA6B;IACpF,OAAO;QACH,QAAQ;QACR,qBAAqB;QACrB,SAAS,EAAE,CAAC;KACf,CAAC;AACN,CAAC;AAND,4DAMC;AAED,SAAgB,sBAAsB,CAAC,SAAiB,EAAE,mBAA4B;IAClF,IAAI,mBAAmB,EAAE,CAAC;QACtB,OAAO;YACH,mBAAmB,EAAE,SAAS;YAC9B,mBAAmB,EAAE,CAAC;YACtB,mBAAmB,EAAE,CAAC;YACtB,aAAa,EAAE,CAAC;SACnB,CAAC;IACN,CAAC;SAAM,CAAC;QACJ,OAAO;YACH,mBAAmB,EAAE,CAAC;YACtB,mBAAmB,EAAE,SAAS;YAC9B,mBAAmB,EAAE,CAAC;YACtB,aAAa,EAAE,CAAC;SACnB,CAAC;IACN,CAAC;AACL,CAAC;AAhBD,wDAgBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MetricOutput, AnalyticsFromRequests } from '../../common/plugin-metrics-types';
|
|
2
|
+
export declare class PluginMetricTimeCount implements MetricOutput {
|
|
3
|
+
header: string;
|
|
4
|
+
createMetricOutput(id: string, method: string, requestAnalytics: AnalyticsFromRequests): string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=plugin-metrics-time-count.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-time-count.d.ts","sourceRoot":"","sources":["../../../src/node/metric-output/plugin-metrics-time-count.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,qBACa,qBAAsB,YAAW,YAAY;IAE/C,MAAM,SAAqH;IAElI,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,MAAM;CAWlG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PluginMetricTimeCount = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
let PluginMetricTimeCount = class PluginMetricTimeCount {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.header = '# HELP language_server_time_count Number of language server requests\n# TYPE language_server_time_count gauge\n';
|
|
24
|
+
}
|
|
25
|
+
createMetricOutput(id, method, requestAnalytics) {
|
|
26
|
+
if (requestAnalytics.successfulResponses < 0) {
|
|
27
|
+
requestAnalytics.successfulResponses = 0;
|
|
28
|
+
}
|
|
29
|
+
const successMetric = `language_server_time_count{id="${id}" method="${method}" result="success"} ${requestAnalytics.successfulResponses}\n`;
|
|
30
|
+
const failedRequests = requestAnalytics.totalRequests - requestAnalytics.successfulResponses;
|
|
31
|
+
const failureMetric = `language_server_time_count{id="${id}" method="${method}" result="fail"} ${failedRequests}\n`;
|
|
32
|
+
return successMetric + failureMetric;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.PluginMetricTimeCount = PluginMetricTimeCount;
|
|
36
|
+
exports.PluginMetricTimeCount = PluginMetricTimeCount = tslib_1.__decorate([
|
|
37
|
+
(0, inversify_1.injectable)()
|
|
38
|
+
], PluginMetricTimeCount);
|
|
39
|
+
//# sourceMappingURL=plugin-metrics-time-count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-time-count.js","sourceRoot":"","sources":["../../../src/node/metric-output/plugin-metrics-time-count.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAA0D;AAGnD,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAA3B;QAEI,WAAM,GAAG,iHAAiH,CAAC;IAatI,CAAC;IAXG,kBAAkB,CAAC,EAAU,EAAE,MAAc,EAAE,gBAAuC;QAClF,IAAI,gBAAgB,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;YAC3C,gBAAgB,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,aAAa,GAAG,kCAAkC,EAAE,aAAa,MAAM,uBAAuB,gBAAgB,CAAC,mBAAmB,IAAI,CAAC;QAE7I,MAAM,cAAc,GAAG,gBAAgB,CAAC,aAAa,GAAG,gBAAgB,CAAC,mBAAmB,CAAC;QAC7F,MAAM,aAAa,GAAG,kCAAkC,EAAE,aAAa,MAAM,oBAAoB,cAAc,IAAI,CAAC;QACpH,OAAO,aAAa,GAAG,aAAa,CAAC;IACzC,CAAC;CAEJ,CAAA;AAfY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CAejC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MetricOutput, AnalyticsFromRequests } from '../../common/plugin-metrics-types';
|
|
2
|
+
export declare class PluginMetricTimeSum implements MetricOutput {
|
|
3
|
+
header: string;
|
|
4
|
+
createMetricOutput(id: string, method: string, requestAnalytics: AnalyticsFromRequests): string;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=plugin-metrics-time-sum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-time-sum.d.ts","sourceRoot":"","sources":["../../../src/node/metric-output/plugin-metrics-time-sum.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAGxF,qBACa,mBAAoB,YAAW,YAAY;IAE7C,MAAM,SAA6I;IAE1J,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,GAAG,MAAM;CAUlG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PluginMetricTimeSum = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
let PluginMetricTimeSum = class PluginMetricTimeSum {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.header = '# HELP language_server_time_sum Sum of time in milliseconds that language server requests take\n# TYPE language_server_time_sum gauge\n';
|
|
24
|
+
}
|
|
25
|
+
createMetricOutput(id, method, requestAnalytics) {
|
|
26
|
+
const successTime = requestAnalytics.sumOfTimeForSuccess;
|
|
27
|
+
const success = `language_server_time_sum{id="${id}" method="${method}" result="success"} ${successTime}\n`;
|
|
28
|
+
const failureTime = requestAnalytics.sumOfTimeForFailure;
|
|
29
|
+
const failure = `language_server_time_sum{id="${id}" method="${method}" result="failure"} ${failureTime}\n`;
|
|
30
|
+
return success + failure;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.PluginMetricTimeSum = PluginMetricTimeSum;
|
|
34
|
+
exports.PluginMetricTimeSum = PluginMetricTimeSum = tslib_1.__decorate([
|
|
35
|
+
(0, inversify_1.injectable)()
|
|
36
|
+
], PluginMetricTimeSum);
|
|
37
|
+
//# sourceMappingURL=plugin-metrics-time-sum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-metrics-time-sum.js","sourceRoot":"","sources":["../../../src/node/metric-output/plugin-metrics-time-sum.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAA0D;AAGnD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAAzB;QAEI,WAAM,GAAG,yIAAyI,CAAC;IAY9J,CAAC;IAVG,kBAAkB,CAAC,EAAU,EAAE,MAAc,EAAE,gBAAuC;QAClF,MAAM,WAAW,GAAG,gBAAgB,CAAC,mBAAmB,CAAC;QACzD,MAAM,OAAO,GAAG,gCAAgC,EAAE,aAAa,MAAM,uBAAuB,WAAW,IAAI,CAAC;QAE5G,MAAM,WAAW,GAAG,gBAAgB,CAAC,mBAAmB,CAAC;QACzD,MAAM,OAAO,GAAG,gCAAgC,EAAE,aAAa,MAAM,uBAAuB,WAAW,IAAI,CAAC;QAE5G,OAAO,OAAO,GAAG,OAAO,CAAC;IAC7B,CAAC;CAEJ,CAAA;AAdY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;GACA,mBAAmB,CAc/B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MetricsMap } from '../common/plugin-metrics-types';
|
|
2
|
+
export declare class PluginMetricStringGenerator {
|
|
3
|
+
private pluginMetricsTimeCount;
|
|
4
|
+
private pluginMetricsTimeSum;
|
|
5
|
+
getMetricsString(extensionIDAnalytics: MetricsMap): string;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=metric-string-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric-string-generator.d.ts","sourceRoot":"","sources":["../../src/node/metric-string-generator.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAG5D,qBACa,2BAA2B;IAGpC,OAAO,CAAC,sBAAsB,CAAwB;IAGtD,OAAO,CAAC,oBAAoB,CAAsB;IAElD,gBAAgB,CAAC,oBAAoB,EAAE,UAAU,GAAG,MAAM;CAwC7D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginMetricStringGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
// *****************************************************************************
|
|
6
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
7
|
+
//
|
|
8
|
+
// This program and the accompanying materials are made available under the
|
|
9
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
10
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
11
|
+
//
|
|
12
|
+
// This Source Code may also be made available under the following Secondary
|
|
13
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
14
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
15
|
+
// with the GNU Classpath Exception which is available at
|
|
16
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
17
|
+
//
|
|
18
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
19
|
+
// *****************************************************************************
|
|
20
|
+
const plugin_metrics_time_count_1 = require("./metric-output/plugin-metrics-time-count");
|
|
21
|
+
const plugin_metrics_time_sum_1 = require("./metric-output/plugin-metrics-time-sum");
|
|
22
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
23
|
+
let PluginMetricStringGenerator = class PluginMetricStringGenerator {
|
|
24
|
+
getMetricsString(extensionIDAnalytics) {
|
|
25
|
+
if (Object.keys(extensionIDAnalytics).length === 0) {
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
let metricString = this.pluginMetricsTimeCount.header;
|
|
29
|
+
for (const extensionID in extensionIDAnalytics) {
|
|
30
|
+
if (!extensionIDAnalytics.hasOwnProperty(extensionID)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
const methodToAnalytic = extensionIDAnalytics[extensionID];
|
|
34
|
+
for (const method in methodToAnalytic) {
|
|
35
|
+
if (!methodToAnalytic.hasOwnProperty(method)) {
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const analytic = methodToAnalytic[method];
|
|
39
|
+
metricString += this.pluginMetricsTimeCount.createMetricOutput(extensionID, method, analytic);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
metricString += this.pluginMetricsTimeSum.header;
|
|
43
|
+
for (const extensionID in extensionIDAnalytics) {
|
|
44
|
+
if (!extensionIDAnalytics.hasOwnProperty(extensionID)) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const methodToAnalytic = extensionIDAnalytics[extensionID];
|
|
48
|
+
for (const method in methodToAnalytic) {
|
|
49
|
+
if (!methodToAnalytic.hasOwnProperty(method)) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
const analytic = methodToAnalytic[method];
|
|
53
|
+
metricString += this.pluginMetricsTimeSum.createMetricOutput(extensionID, method, analytic);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return metricString;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
exports.PluginMetricStringGenerator = PluginMetricStringGenerator;
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, inversify_1.inject)(plugin_metrics_time_count_1.PluginMetricTimeCount),
|
|
62
|
+
tslib_1.__metadata("design:type", plugin_metrics_time_count_1.PluginMetricTimeCount)
|
|
63
|
+
], PluginMetricStringGenerator.prototype, "pluginMetricsTimeCount", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, inversify_1.inject)(plugin_metrics_time_sum_1.PluginMetricTimeSum),
|
|
66
|
+
tslib_1.__metadata("design:type", plugin_metrics_time_sum_1.PluginMetricTimeSum)
|
|
67
|
+
], PluginMetricStringGenerator.prototype, "pluginMetricsTimeSum", void 0);
|
|
68
|
+
exports.PluginMetricStringGenerator = PluginMetricStringGenerator = tslib_1.__decorate([
|
|
69
|
+
(0, inversify_1.injectable)()
|
|
70
|
+
], PluginMetricStringGenerator);
|
|
71
|
+
//# sourceMappingURL=metric-string-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metric-string-generator.js","sourceRoot":"","sources":["../../src/node/metric-string-generator.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;AAChF,yFAAkF;AAClF,qFAA8E;AAE9E,4DAAkE;AAG3D,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAQpC,gBAAgB,CAAC,oBAAgC;QAE7C,IAAI,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACjD,OAAO,EAAE,CAAC;QACd,CAAC;QAED,IAAI,YAAY,GAAG,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC;QACtD,KAAK,MAAM,WAAW,IAAI,oBAAoB,EAAE,CAAC;YAC7C,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;gBACpD,SAAS;YACb,CAAC;YAED,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;YAC3D,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;gBACpC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3C,SAAS;gBACb,CAAC;gBACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC1C,YAAY,IAAI,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAClG,CAAC;QACL,CAAC;QAED,YAAY,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC;QACjD,KAAK,MAAM,WAAW,IAAI,oBAAoB,EAAE,CAAC;YAC7C,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;gBACpD,SAAS;YACb,CAAC;YAED,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;YAC3D,KAAK,MAAM,MAAM,IAAI,gBAAgB,EAAE,CAAC;gBACpC,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3C,SAAS;gBACb,CAAC;gBACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;gBAC1C,YAAY,IAAI,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;YAChG,CAAC;QACL,CAAC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ,CAAA;AAhDY,kEAA2B;AAG5B;IADP,IAAA,kBAAM,EAAC,iDAAqB,CAAC;sCACE,iDAAqB;2EAAC;AAG9C;IADP,IAAA,kBAAM,EAAC,6CAAmB,CAAC;sCACE,6CAAmB;yEAAC;sCANzC,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CAgDvC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PluginMetrics } from '../common/metrics-protocol';
|
|
2
|
+
import { MetricsMap } from '../common/plugin-metrics-types';
|
|
3
|
+
export declare class PluginMetricsContributor {
|
|
4
|
+
clients: Set<PluginMetrics>;
|
|
5
|
+
reconcile(): MetricsMap;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=metrics-contributor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-contributor.d.ts","sourceRoot":"","sources":["../../src/node/metrics-contributor.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAyB,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEnF,qBACa,wBAAwB;IACjC,OAAO,EAAE,GAAG,CAAC,aAAa,CAAC,CAAa;IAExC,SAAS,IAAI,UAAU;CA6C1B"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2019 Red Hat, Inc. and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.PluginMetricsContributor = void 0;
|
|
19
|
+
const tslib_1 = require("tslib");
|
|
20
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
+
let PluginMetricsContributor = class PluginMetricsContributor {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.clients = new Set();
|
|
24
|
+
}
|
|
25
|
+
reconcile() {
|
|
26
|
+
const reconciledMap = {};
|
|
27
|
+
this.clients.forEach(c => {
|
|
28
|
+
const extensionIDtoMap = JSON.parse(c.getMetrics());
|
|
29
|
+
for (const vscodeExtensionID in extensionIDtoMap) {
|
|
30
|
+
if (!extensionIDtoMap.hasOwnProperty(vscodeExtensionID)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!reconciledMap[vscodeExtensionID]) {
|
|
34
|
+
reconciledMap[vscodeExtensionID] = extensionIDtoMap[vscodeExtensionID];
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const methodToAnalytics = extensionIDtoMap[vscodeExtensionID];
|
|
38
|
+
for (const method in methodToAnalytics) {
|
|
39
|
+
if (!methodToAnalytics.hasOwnProperty(method)) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (!reconciledMap[vscodeExtensionID][method]) {
|
|
43
|
+
reconciledMap[vscodeExtensionID][method] = methodToAnalytics[method];
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const currentAnalytic = reconciledMap[vscodeExtensionID][method];
|
|
47
|
+
if (!methodToAnalytics[method]) {
|
|
48
|
+
reconciledMap[vscodeExtensionID][method] = currentAnalytic;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// It does have the method
|
|
52
|
+
// Then we need to reconcile the two analytics from requests
|
|
53
|
+
const newAnalytic = methodToAnalytics[method];
|
|
54
|
+
newAnalytic.sumOfTimeForSuccess = newAnalytic.sumOfTimeForSuccess + currentAnalytic.sumOfTimeForSuccess;
|
|
55
|
+
newAnalytic.sumOfTimeForFailure = newAnalytic.sumOfTimeForFailure + currentAnalytic.sumOfTimeForFailure;
|
|
56
|
+
newAnalytic.totalRequests += currentAnalytic.totalRequests;
|
|
57
|
+
newAnalytic.successfulResponses += currentAnalytic.successfulResponses;
|
|
58
|
+
reconciledMap[vscodeExtensionID][method] = newAnalytic;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return reconciledMap;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
exports.PluginMetricsContributor = PluginMetricsContributor;
|
|
69
|
+
exports.PluginMetricsContributor = PluginMetricsContributor = tslib_1.__decorate([
|
|
70
|
+
(0, inversify_1.injectable)()
|
|
71
|
+
], PluginMetricsContributor);
|
|
72
|
+
//# sourceMappingURL=metrics-contributor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-contributor.js","sourceRoot":"","sources":["../../src/node/metrics-contributor.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,+CAA+C;AAC/C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAGhF,4DAA0D;AAInD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IAA9B;QACH,YAAO,GAAuB,IAAI,GAAG,EAAE,CAAC;IA+C5C,CAAC;IA7CG,SAAS;QACL,MAAM,aAAa,GAAe,EAAE,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACrB,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,CAAe,CAAC;YAElE,KAAK,MAAM,iBAAiB,IAAI,gBAAgB,EAAE,CAAC;gBAC/C,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBACtD,SAAS;gBACb,CAAC;gBAED,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,EAAE,CAAC;oBACpC,aAAa,CAAC,iBAAiB,CAAC,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;gBAC3E,CAAC;qBAAM,CAAC;oBACJ,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;oBAC9D,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;wBAErC,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;4BAC5C,SAAS;wBACb,CAAC;wBAED,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;4BAC5C,aAAa,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;wBACzE,CAAC;6BAAM,CAAC;4BACJ,MAAM,eAAe,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;4BACjE,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;gCAC7B,aAAa,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC;4BAC/D,CAAC;iCAAM,CAAC;gCACJ,0BAA0B;gCAC1B,4DAA4D;gCAC5D,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,CAA0B,CAAC;gCACvE,WAAW,CAAC,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,GAAG,eAAe,CAAC,mBAAmB,CAAC;gCACxG,WAAW,CAAC,mBAAmB,GAAG,WAAW,CAAC,mBAAmB,GAAG,eAAe,CAAC,mBAAmB,CAAC;gCACxG,WAAW,CAAC,aAAa,IAAI,eAAe,CAAC,aAAa,CAAC;gCAC3D,WAAW,CAAC,mBAAmB,IAAI,eAAe,CAAC,mBAAmB,CAAC;gCAEvE,aAAa,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC;4BAC3D,CAAC;wBACL,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QACH,OAAO,aAAa,CAAC;IACzB,CAAC;CAEJ,CAAA;AAhDY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAgDpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics-contributor.spec.d.ts","sourceRoot":"","sources":["../../src/node/metrics-contributor.spec.ts"],"names":[],"mappings":""}
|