@theia/plugin-metrics 1.67.0-next.13 → 1.67.0-next.56

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.
Files changed (62) hide show
  1. package/README.md +2 -2
  2. package/package.json +6 -6
  3. package/lib/browser/plugin-metrics-creator.d.ts +0 -68
  4. package/lib/browser/plugin-metrics-creator.d.ts.map +0 -1
  5. package/lib/browser/plugin-metrics-creator.js +0 -178
  6. package/lib/browser/plugin-metrics-creator.js.map +0 -1
  7. package/lib/browser/plugin-metrics-frontend-module.d.ts +0 -4
  8. package/lib/browser/plugin-metrics-frontend-module.d.ts.map +0 -1
  9. package/lib/browser/plugin-metrics-frontend-module.js +0 -37
  10. package/lib/browser/plugin-metrics-frontend-module.js.map +0 -1
  11. package/lib/browser/plugin-metrics-languages-main.d.ts +0 -59
  12. package/lib/browser/plugin-metrics-languages-main.d.ts.map +0 -1
  13. package/lib/browser/plugin-metrics-languages-main.js +0 -204
  14. package/lib/browser/plugin-metrics-languages-main.js.map +0 -1
  15. package/lib/browser/plugin-metrics-output-registry.d.ts +0 -8
  16. package/lib/browser/plugin-metrics-output-registry.d.ts.map +0 -1
  17. package/lib/browser/plugin-metrics-output-registry.js +0 -41
  18. package/lib/browser/plugin-metrics-output-registry.js.map +0 -1
  19. package/lib/browser/plugin-metrics-resolver.d.ts +0 -18
  20. package/lib/browser/plugin-metrics-resolver.d.ts.map +0 -1
  21. package/lib/browser/plugin-metrics-resolver.js +0 -62
  22. package/lib/browser/plugin-metrics-resolver.js.map +0 -1
  23. package/lib/common/metrics-protocol.d.ts +0 -11
  24. package/lib/common/metrics-protocol.d.ts.map +0 -1
  25. package/lib/common/metrics-protocol.js +0 -25
  26. package/lib/common/metrics-protocol.js.map +0 -1
  27. package/lib/common/plugin-metrics-types.d.ts +0 -28
  28. package/lib/common/plugin-metrics-types.d.ts.map +0 -1
  29. package/lib/common/plugin-metrics-types.js +0 -57
  30. package/lib/common/plugin-metrics-types.js.map +0 -1
  31. package/lib/node/metric-output/plugin-metrics-time-count.d.ts +0 -6
  32. package/lib/node/metric-output/plugin-metrics-time-count.d.ts.map +0 -1
  33. package/lib/node/metric-output/plugin-metrics-time-count.js +0 -39
  34. package/lib/node/metric-output/plugin-metrics-time-count.js.map +0 -1
  35. package/lib/node/metric-output/plugin-metrics-time-sum.d.ts +0 -6
  36. package/lib/node/metric-output/plugin-metrics-time-sum.d.ts.map +0 -1
  37. package/lib/node/metric-output/plugin-metrics-time-sum.js +0 -37
  38. package/lib/node/metric-output/plugin-metrics-time-sum.js.map +0 -1
  39. package/lib/node/metric-string-generator.d.ts +0 -7
  40. package/lib/node/metric-string-generator.d.ts.map +0 -1
  41. package/lib/node/metric-string-generator.js +0 -71
  42. package/lib/node/metric-string-generator.js.map +0 -1
  43. package/lib/node/metrics-contributor.d.ts +0 -7
  44. package/lib/node/metrics-contributor.d.ts.map +0 -1
  45. package/lib/node/metrics-contributor.js +0 -72
  46. package/lib/node/metrics-contributor.js.map +0 -1
  47. package/lib/node/metrics-contributor.spec.d.ts +0 -2
  48. package/lib/node/metrics-contributor.spec.d.ts.map +0 -1
  49. package/lib/node/metrics-contributor.spec.js +0 -204
  50. package/lib/node/metrics-contributor.spec.js.map +0 -1
  51. package/lib/node/plugin-metrics-backend-module.d.ts +0 -4
  52. package/lib/node/plugin-metrics-backend-module.d.ts.map +0 -1
  53. package/lib/node/plugin-metrics-backend-module.js +0 -48
  54. package/lib/node/plugin-metrics-backend-module.js.map +0 -1
  55. package/lib/node/plugin-metrics-impl.d.ts +0 -11
  56. package/lib/node/plugin-metrics-impl.d.ts.map +0 -1
  57. package/lib/node/plugin-metrics-impl.js +0 -41
  58. package/lib/node/plugin-metrics-impl.js.map +0 -1
  59. package/lib/node/plugin-metrics.d.ts +0 -11
  60. package/lib/node/plugin-metrics.d.ts.map +0 -1
  61. package/lib/node/plugin-metrics.js +0 -47
  62. package/lib/node/plugin-metrics.js.map +0 -1
@@ -1,37 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,71 +0,0 @@
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
@@ -1 +0,0 @@
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,I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;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"}
@@ -1,7 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,72 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":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,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"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=metrics-contributor.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics-contributor.spec.d.ts","sourceRoot":"","sources":["../../src/node/metrics-contributor.spec.ts"],"names":[],"mappings":""}
@@ -1,204 +0,0 @@
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
- const metrics_contributor_1 = require("./metrics-contributor");
19
- const inversify_1 = require("@theia/core/shared/inversify");
20
- const plugin_metrics_impl_1 = require("./plugin-metrics-impl");
21
- const metrics_protocol_1 = require("../common/metrics-protocol");
22
- const assert = require("assert");
23
- describe('Metrics contributor:', () => {
24
- let testContainer;
25
- before(() => {
26
- testContainer = new inversify_1.Container();
27
- const module = new inversify_1.ContainerModule(bind => {
28
- bind(metrics_protocol_1.PluginMetrics).to(plugin_metrics_impl_1.PluginMetricsImpl).inTransientScope();
29
- bind(metrics_contributor_1.PluginMetricsContributor).toSelf().inTransientScope();
30
- });
31
- testContainer.load(module);
32
- });
33
- describe('reconcile:', () => {
34
- it('Reconcile with one client connected', async () => {
35
- // given
36
- const analytics = {
37
- sumOfTimeForFailure: 0,
38
- sumOfTimeForSuccess: 5,
39
- successfulResponses: 10,
40
- totalRequests: 15
41
- };
42
- const metricExtensionID = 'my_test_metric.test_metric';
43
- const metricMethod = 'textDocument/testMethod';
44
- const metricsMap = {
45
- [metricExtensionID]: {
46
- [metricMethod]: analytics
47
- }
48
- };
49
- const metricsContributor = testContainer.get(metrics_contributor_1.PluginMetricsContributor);
50
- const pluginMetrics = testContainer.get(metrics_protocol_1.PluginMetrics);
51
- pluginMetrics.setMetrics(JSON.stringify(metricsMap));
52
- metricsContributor.clients.add(pluginMetrics);
53
- // when
54
- const reconciledMap = metricsContributor.reconcile();
55
- // then
56
- assert.deepStrictEqual(reconciledMap, metricsMap);
57
- });
58
- it('Reconcile same extension id and method with two clients connected', async () => {
59
- // given
60
- // first client
61
- const firstClientAnalytics = {
62
- sumOfTimeForFailure: 0,
63
- sumOfTimeForSuccess: 5,
64
- successfulResponses: 10,
65
- totalRequests: 15
66
- };
67
- const firstClientMetricExtensionID = 'my_test_metric.test_metric';
68
- const firstClientMetricMethod = 'textDocument/testMethod';
69
- const firstClientMetricsMap = {
70
- [firstClientMetricExtensionID]: {
71
- [firstClientMetricMethod]: firstClientAnalytics
72
- }
73
- };
74
- const secondClientAnalytics = {
75
- sumOfTimeForFailure: 0,
76
- sumOfTimeForSuccess: 15,
77
- successfulResponses: 20,
78
- totalRequests: 18
79
- };
80
- const secondClientMetricsMap = {
81
- [firstClientMetricExtensionID]: {
82
- [firstClientMetricMethod]: secondClientAnalytics
83
- }
84
- };
85
- const metricsContributor = testContainer.get(metrics_contributor_1.PluginMetricsContributor);
86
- const firstClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
87
- firstClientPluginMetric.setMetrics(JSON.stringify(firstClientMetricsMap));
88
- metricsContributor.clients.add(firstClientPluginMetric);
89
- const secondClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
90
- secondClientPluginMetric.setMetrics(JSON.stringify(secondClientMetricsMap));
91
- metricsContributor.clients.add(secondClientPluginMetric);
92
- // when
93
- const reconciledMap = metricsContributor.reconcile();
94
- // then
95
- const expectedAnalytics = {
96
- sumOfTimeForFailure: 0,
97
- sumOfTimeForSuccess: 20,
98
- successfulResponses: 30,
99
- totalRequests: 33
100
- };
101
- const expectedMap = {
102
- [firstClientMetricExtensionID]: {
103
- [firstClientMetricMethod]: expectedAnalytics
104
- }
105
- };
106
- assert.deepStrictEqual(reconciledMap, expectedMap);
107
- });
108
- it('Reconcile different extension id and method with two clients connected', async () => {
109
- // given
110
- // first client
111
- const firstClientAnalytics = {
112
- sumOfTimeForFailure: 0,
113
- sumOfTimeForSuccess: 5,
114
- successfulResponses: 10,
115
- totalRequests: 15
116
- };
117
- const firstClientMetricExtensionID = 'my_test_metric.test_metric';
118
- const firstClientMetricMethod = 'textDocument/testMethod';
119
- const firstClientMetricsMap = {
120
- [firstClientMetricExtensionID]: {
121
- [firstClientMetricMethod]: firstClientAnalytics
122
- }
123
- };
124
- const secondClientAnalytics = {
125
- sumOfTimeForFailure: 0,
126
- sumOfTimeForSuccess: 15,
127
- successfulResponses: 20,
128
- totalRequests: 18
129
- };
130
- const secondClientMetricExtensionID = 'my_other_test_metric.test_metric';
131
- const secondClientMetricsMap = {
132
- [secondClientMetricExtensionID]: {
133
- [firstClientMetricMethod]: secondClientAnalytics
134
- }
135
- };
136
- const metricsContributor = testContainer.get(metrics_contributor_1.PluginMetricsContributor);
137
- const firstClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
138
- firstClientPluginMetric.setMetrics(JSON.stringify(firstClientMetricsMap));
139
- metricsContributor.clients.add(firstClientPluginMetric);
140
- const secondClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
141
- secondClientPluginMetric.setMetrics(JSON.stringify(secondClientMetricsMap));
142
- metricsContributor.clients.add(secondClientPluginMetric);
143
- // when
144
- const reconciledMap = metricsContributor.reconcile();
145
- // then
146
- const expectedMap = {
147
- [firstClientMetricExtensionID]: {
148
- [firstClientMetricMethod]: firstClientAnalytics
149
- },
150
- [secondClientMetricExtensionID]: {
151
- [firstClientMetricMethod]: secondClientAnalytics
152
- }
153
- };
154
- assert.deepStrictEqual(reconciledMap, expectedMap);
155
- });
156
- it('Reconcile same extension id and different method with two clients connected', async () => {
157
- // given
158
- // first client
159
- const firstClientAnalytics = {
160
- sumOfTimeForFailure: 0,
161
- sumOfTimeForSuccess: 5,
162
- successfulResponses: 10,
163
- totalRequests: 15
164
- };
165
- const firstClientMetricExtensionID = 'my_test_metric.test_metric';
166
- const firstClientMetricMethod = 'textDocument/testMethod';
167
- const firstClientMetricsMap = {
168
- [firstClientMetricExtensionID]: {
169
- [firstClientMetricMethod]: firstClientAnalytics
170
- }
171
- };
172
- const secondClientAnalytics = {
173
- sumOfTimeForFailure: 0,
174
- sumOfTimeForSuccess: 15,
175
- successfulResponses: 20,
176
- totalRequests: 18
177
- };
178
- const secondClientMetricMethod = 'textDocument/myOthertestMethod';
179
- const secondClientMetricsMap = {
180
- [firstClientMetricExtensionID]: {
181
- [secondClientMetricMethod]: secondClientAnalytics
182
- }
183
- };
184
- const metricsContributor = testContainer.get(metrics_contributor_1.PluginMetricsContributor);
185
- const firstClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
186
- firstClientPluginMetric.setMetrics(JSON.stringify(firstClientMetricsMap));
187
- metricsContributor.clients.add(firstClientPluginMetric);
188
- const secondClientPluginMetric = testContainer.get(metrics_protocol_1.PluginMetrics);
189
- secondClientPluginMetric.setMetrics(JSON.stringify(secondClientMetricsMap));
190
- metricsContributor.clients.add(secondClientPluginMetric);
191
- // when
192
- const reconciledMap = metricsContributor.reconcile();
193
- // then
194
- const expectedMap = {
195
- [firstClientMetricExtensionID]: {
196
- [firstClientMetricMethod]: firstClientAnalytics,
197
- [secondClientMetricMethod]: secondClientAnalytics
198
- }
199
- };
200
- assert.deepStrictEqual(reconciledMap, expectedMap);
201
- });
202
- });
203
- });
204
- //# sourceMappingURL=metrics-contributor.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics-contributor.spec.js","sourceRoot":"","sources":["../../src/node/metrics-contributor.spec.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,+DAAiE;AACjE,4DAA0E;AAC1E,+DAA0D;AAC1D,iEAA2D;AAC3D,i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AAE,WAAW,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
4
- //# sourceMappingURL=plugin-metrics-backend-module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-metrics-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/plugin-metrics-backend-module.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAM/D,wBAoBG"}
@@ -1,48 +0,0 @@
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
- const metrics_contribution_1 = require("@theia/metrics/lib/node/metrics-contribution");
19
- const plugin_metrics_1 = require("./plugin-metrics");
20
- const metrics_protocol_1 = require("../common/metrics-protocol");
21
- const plugin_metrics_impl_1 = require("./plugin-metrics-impl");
22
- const handler_1 = require("@theia/core/lib/common/messaging/handler");
23
- const core_1 = require("@theia/core");
24
- const inversify_1 = require("@theia/core/shared/inversify");
25
- const metrics_contributor_1 = require("./metrics-contributor");
26
- const plugin_metrics_time_sum_1 = require("./metric-output/plugin-metrics-time-sum");
27
- const plugin_metrics_time_count_1 = require("./metric-output/plugin-metrics-time-count");
28
- const metric_string_generator_1 = require("./metric-string-generator");
29
- exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
30
- bind(plugin_metrics_time_sum_1.PluginMetricTimeSum).toSelf().inSingletonScope();
31
- bind(plugin_metrics_time_count_1.PluginMetricTimeCount).toSelf().inSingletonScope();
32
- bind(metrics_protocol_1.PluginMetrics).to(plugin_metrics_impl_1.PluginMetricsImpl).inTransientScope();
33
- bind(metric_string_generator_1.PluginMetricStringGenerator).toSelf().inSingletonScope();
34
- bind(metrics_contributor_1.PluginMetricsContributor).toSelf().inSingletonScope();
35
- bind(handler_1.ConnectionHandler).toDynamicValue(ctx => {
36
- const clients = ctx.container.get(metrics_contributor_1.PluginMetricsContributor);
37
- return new core_1.RpcConnectionHandler(metrics_protocol_1.metricsJsonRpcPath, client => {
38
- const pluginMetricsHandler = ctx.container.get(metrics_protocol_1.PluginMetrics);
39
- clients.clients.add(pluginMetricsHandler);
40
- client.onDidCloseConnection(() => {
41
- clients.clients.delete(pluginMetricsHandler);
42
- });
43
- return pluginMetricsHandler;
44
- });
45
- }).inSingletonScope();
46
- bind(metrics_contribution_1.MetricsContribution).to(plugin_metrics_1.PluginMetricsContribution).inSingletonScope();
47
- });
48
- //# sourceMappingURL=plugin-metrics-backend-module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-metrics-backend-module.js","sourceRoot":"","sources":["../../src/node/plugin-metrics-backend-module.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,uFAAmF;AACnF,qDAA6D;AAC7D,iEAA+E;AAC/E,+DAA0D;AAC1D,sEAA6E;AAC7E,sCAAmD;AACnD,4DAA+D;AAC/D,+DAAiE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,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import { PluginMetrics } from '../common/metrics-protocol';
2
- export declare class PluginMetricsImpl implements PluginMetrics {
3
- private metrics;
4
- setMetrics(metrics: string): void;
5
- /**
6
- * This sends all the information about metrics inside of the plugins to the backend
7
- * where it is served on the /metrics endpoint
8
- */
9
- getMetrics(): string;
10
- }
11
- //# sourceMappingURL=plugin-metrics-impl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-metrics-impl.d.ts","sourceRoot":"","sources":["../../src/node/plugin-metrics-impl.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,qBACa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,OAAO,CAAgB;IAG/B,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B;;;OAGG;IACH,UAAU,IAAI,MAAM;CAIvB"}
@@ -1,41 +0,0 @@
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.PluginMetricsImpl = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- let PluginMetricsImpl = class PluginMetricsImpl {
22
- constructor() {
23
- this.metrics = '{}';
24
- }
25
- // tslint:disable-next-line:typedef
26
- setMetrics(metrics) {
27
- this.metrics = metrics;
28
- }
29
- /**
30
- * This sends all the information about metrics inside of the plugins to the backend
31
- * where it is served on the /metrics endpoint
32
- */
33
- getMetrics() {
34
- return this.metrics;
35
- }
36
- };
37
- exports.PluginMetricsImpl = PluginMetricsImpl;
38
- exports.PluginMetricsImpl = PluginMetricsImpl = tslib_1.__decorate([
39
- (0, inversify_1.injectable)()
40
- ], PluginMetricsImpl);
41
- //# sourceMappingURL=plugin-metrics-impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-metrics-impl.js","sourceRoot":"","sources":["../../src/node/plugin-metrics-impl.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,4DAA0D;AAInD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAAvB;QAEK,YAAO,GAAW,IAAI,CAAC;IAenC,CAAC;IAbG,mCAAmC;IACnC,UAAU,CAAC,OAAe;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CAEJ,CAAA;AAjBY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,sBAAU,GAAE;GACA,iBAAiB,CAiB7B"}
@@ -1,11 +0,0 @@
1
- import { MetricsContribution } from '@theia/metrics/lib/node/metrics-contribution';
2
- import { PluginMetricsContributor } from './metrics-contributor';
3
- import { PluginMetricStringGenerator } from './metric-string-generator';
4
- export declare class PluginMetricsContribution implements MetricsContribution {
5
- protected readonly metricsContributor: PluginMetricsContributor;
6
- protected readonly stringGenerator: PluginMetricStringGenerator;
7
- private metrics;
8
- getMetrics(): string;
9
- startCollecting(): void;
10
- }
11
- //# sourceMappingURL=plugin-metrics.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-metrics.d.ts","sourceRoot":"","sources":["../../src/node/plugin-metrics.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC;AAEnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAExE,qBACa,yBAA0B,YAAW,mBAAmB;IAGjE,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,wBAAwB,CAAC;IAGhE,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,2BAA2B,CAAC;IAEhE,OAAO,CAAC,OAAO,CAAS;IAExB,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,IAAI;CAM1B"}