@theia/metrics 1.45.0 → 1.46.0-next.72

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 (41) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/metrics-frontend-application-contribution.d.ts +12 -12
  3. package/lib/browser/metrics-frontend-application-contribution.js +66 -66
  4. package/lib/browser/metrics-frontend-module.d.ts +3 -3
  5. package/lib/browser/metrics-frontend-module.js +28 -28
  6. package/lib/common/index.d.ts +1 -1
  7. package/lib/common/index.js +28 -28
  8. package/lib/common/measurement-notification-service.d.ts +11 -11
  9. package/lib/common/measurement-notification-service.js +20 -20
  10. package/lib/node/extensions-metrics-contribution.d.ts +8 -8
  11. package/lib/node/extensions-metrics-contribution.js +62 -62
  12. package/lib/node/index.d.ts +5 -5
  13. package/lib/node/index.js +32 -32
  14. package/lib/node/measurement-metrics-contribution.d.ts +17 -17
  15. package/lib/node/measurement-metrics-contribution.js +83 -83
  16. package/lib/node/metrics-backend-application-contribution.d.ts +15 -15
  17. package/lib/node/metrics-backend-application-contribution.js +59 -59
  18. package/lib/node/metrics-backend-module.d.ts +3 -3
  19. package/lib/node/metrics-backend-module.js +35 -35
  20. package/lib/node/metrics-contribution.d.ts +5 -5
  21. package/lib/node/metrics-contribution.js +19 -19
  22. package/lib/node/node-metrics-contribution.d.ts +5 -5
  23. package/lib/node/node-metrics-contribution.js +40 -40
  24. package/lib/node/prometheus.d.ts +2 -2
  25. package/lib/node/prometheus.js +27 -27
  26. package/lib/node/prometheus.spec.d.ts +1 -1
  27. package/lib/node/prometheus.spec.js +40 -40
  28. package/package.json +4 -4
  29. package/src/browser/metrics-frontend-application-contribution.ts +51 -51
  30. package/src/browser/metrics-frontend-module.ts +28 -28
  31. package/src/common/index.ts +17 -17
  32. package/src/common/measurement-notification-service.ts +29 -29
  33. package/src/node/extensions-metrics-contribution.ts +51 -51
  34. package/src/node/index.ts +21 -21
  35. package/src/node/measurement-metrics-contribution.ts +75 -75
  36. package/src/node/metrics-backend-application-contribution.ts +50 -50
  37. package/src/node/metrics-backend-module.ts +40 -40
  38. package/src/node/metrics-contribution.ts +20 -20
  39. package/src/node/node-metrics-contribution.ts +33 -33
  40. package/src/node/prometheus.spec.ts +49 -49
  41. package/src/node/prometheus.ts +25 -25
package/README.md CHANGED
@@ -1,30 +1,30 @@
1
- <div align='center'>
2
-
3
- <br />
4
-
5
- <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
-
7
- <h2>ECLIPSE THEIA - METRICS EXTENSION</h2>
8
-
9
- <hr />
10
-
11
- </div>
12
-
13
- ## Description
14
-
15
- The `@theia/metrics` extension provides metrics using the [Prometheus](https://prometheus.io/) API.
16
-
17
- ## Additional Information
18
-
19
- - [API documentation for `@theia/metrics`](https://eclipse-theia.github.io/theia/docs/next/modules/metrics.html)
20
- - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
- - [Theia - Website](https://theia-ide.org/)
22
-
23
- ## License
24
-
25
- - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
- - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
-
28
- ## Trademark
29
- "Theia" is a trademark of the Eclipse Foundation
30
- https://www.eclipse.org/theia
1
+ <div align='center'>
2
+
3
+ <br />
4
+
5
+ <img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />
6
+
7
+ <h2>ECLIPSE THEIA - METRICS EXTENSION</h2>
8
+
9
+ <hr />
10
+
11
+ </div>
12
+
13
+ ## Description
14
+
15
+ The `@theia/metrics` extension provides metrics using the [Prometheus](https://prometheus.io/) API.
16
+
17
+ ## Additional Information
18
+
19
+ - [API documentation for `@theia/metrics`](https://eclipse-theia.github.io/theia/docs/next/modules/metrics.html)
20
+ - [Theia - GitHub](https://github.com/eclipse-theia/theia)
21
+ - [Theia - Website](https://theia-ide.org/)
22
+
23
+ ## License
24
+
25
+ - [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
26
+ - [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)
27
+
28
+ ## Trademark
29
+ "Theia" is a trademark of the Eclipse Foundation
30
+ https://www.eclipse.org/theia
@@ -1,13 +1,13 @@
1
- import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
- import { ILogger, MeasurementResult, Stopwatch } from '@theia/core';
3
- import { MeasurementNotificationService } from '../common';
4
- export declare class MetricsFrontendApplicationContribution implements FrontendApplicationContribution {
5
- protected stopwatch: Stopwatch;
6
- protected notificationService: MeasurementNotificationService;
7
- protected logger: ILogger;
8
- readonly id: string;
9
- initialize(): void;
10
- protected doInitialize(): Promise<void>;
11
- protected notify(result: MeasurementResult): void;
12
- }
1
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser';
2
+ import { ILogger, MeasurementResult, Stopwatch } from '@theia/core';
3
+ import { MeasurementNotificationService } from '../common';
4
+ export declare class MetricsFrontendApplicationContribution implements FrontendApplicationContribution {
5
+ protected stopwatch: Stopwatch;
6
+ protected notificationService: MeasurementNotificationService;
7
+ protected logger: ILogger;
8
+ readonly id: string;
9
+ initialize(): void;
10
+ protected doInitialize(): Promise<void>;
11
+ protected notify(result: MeasurementResult): void;
12
+ }
13
13
  //# sourceMappingURL=metrics-frontend-application-contribution.d.ts.map
@@ -1,67 +1,67 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.MetricsFrontendApplicationContribution = void 0;
13
- // *****************************************************************************
14
- // Copyright (C) 2023 STMicroelectronics and others.
15
- //
16
- // This program and the accompanying materials are made available under the
17
- // terms of the Eclipse Public License v. 2.0 which is available at
18
- // http://www.eclipse.org/legal/epl-2.0.
19
- //
20
- // This Source Code may also be made available under the following Secondary
21
- // Licenses when the conditions for such availability set forth in the Eclipse
22
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
- // with the GNU Classpath Exception which is available at
24
- // https://www.gnu.org/software/classpath/license.html.
25
- //
26
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
27
- // *****************************************************************************
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const core_1 = require("@theia/core");
30
- const coreutils_1 = require("@theia/core/shared/@phosphor/coreutils");
31
- const common_1 = require("../common");
32
- let MetricsFrontendApplicationContribution = class MetricsFrontendApplicationContribution {
33
- constructor() {
34
- this.id = coreutils_1.UUID.uuid4();
35
- }
36
- initialize() {
37
- this.doInitialize();
38
- }
39
- async doInitialize() {
40
- const logLevel = await this.logger.getLogLevel();
41
- if (logLevel !== core_1.LogLevel.DEBUG) {
42
- return;
43
- }
44
- this.stopwatch.storedMeasurements.forEach(result => this.notify(result));
45
- this.stopwatch.onDidAddMeasurementResult(result => this.notify(result));
46
- }
47
- notify(result) {
48
- this.notificationService.onFrontendMeasurement(this.id, result);
49
- }
50
- };
51
- __decorate([
52
- (0, inversify_1.inject)(core_1.Stopwatch),
53
- __metadata("design:type", core_1.Stopwatch)
54
- ], MetricsFrontendApplicationContribution.prototype, "stopwatch", void 0);
55
- __decorate([
56
- (0, inversify_1.inject)(common_1.MeasurementNotificationService),
57
- __metadata("design:type", Object)
58
- ], MetricsFrontendApplicationContribution.prototype, "notificationService", void 0);
59
- __decorate([
60
- (0, inversify_1.inject)(core_1.ILogger),
61
- __metadata("design:type", Object)
62
- ], MetricsFrontendApplicationContribution.prototype, "logger", void 0);
63
- MetricsFrontendApplicationContribution = __decorate([
64
- (0, inversify_1.injectable)()
65
- ], MetricsFrontendApplicationContribution);
66
- exports.MetricsFrontendApplicationContribution = MetricsFrontendApplicationContribution;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MetricsFrontendApplicationContribution = void 0;
13
+ // *****************************************************************************
14
+ // Copyright (C) 2023 STMicroelectronics and others.
15
+ //
16
+ // This program and the accompanying materials are made available under the
17
+ // terms of the Eclipse Public License v. 2.0 which is available at
18
+ // http://www.eclipse.org/legal/epl-2.0.
19
+ //
20
+ // This Source Code may also be made available under the following Secondary
21
+ // Licenses when the conditions for such availability set forth in the Eclipse
22
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ // with the GNU Classpath Exception which is available at
24
+ // https://www.gnu.org/software/classpath/license.html.
25
+ //
26
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
27
+ // *****************************************************************************
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const core_1 = require("@theia/core");
30
+ const coreutils_1 = require("@theia/core/shared/@phosphor/coreutils");
31
+ const common_1 = require("../common");
32
+ let MetricsFrontendApplicationContribution = class MetricsFrontendApplicationContribution {
33
+ constructor() {
34
+ this.id = coreutils_1.UUID.uuid4();
35
+ }
36
+ initialize() {
37
+ this.doInitialize();
38
+ }
39
+ async doInitialize() {
40
+ const logLevel = await this.logger.getLogLevel();
41
+ if (logLevel !== core_1.LogLevel.DEBUG) {
42
+ return;
43
+ }
44
+ this.stopwatch.storedMeasurements.forEach(result => this.notify(result));
45
+ this.stopwatch.onDidAddMeasurementResult(result => this.notify(result));
46
+ }
47
+ notify(result) {
48
+ this.notificationService.onFrontendMeasurement(this.id, result);
49
+ }
50
+ };
51
+ __decorate([
52
+ (0, inversify_1.inject)(core_1.Stopwatch),
53
+ __metadata("design:type", core_1.Stopwatch)
54
+ ], MetricsFrontendApplicationContribution.prototype, "stopwatch", void 0);
55
+ __decorate([
56
+ (0, inversify_1.inject)(common_1.MeasurementNotificationService),
57
+ __metadata("design:type", Object)
58
+ ], MetricsFrontendApplicationContribution.prototype, "notificationService", void 0);
59
+ __decorate([
60
+ (0, inversify_1.inject)(core_1.ILogger),
61
+ __metadata("design:type", Object)
62
+ ], MetricsFrontendApplicationContribution.prototype, "logger", void 0);
63
+ MetricsFrontendApplicationContribution = __decorate([
64
+ (0, inversify_1.injectable)()
65
+ ], MetricsFrontendApplicationContribution);
66
+ exports.MetricsFrontendApplicationContribution = MetricsFrontendApplicationContribution;
67
67
  //# sourceMappingURL=metrics-frontend-application-contribution.js.map
@@ -1,4 +1,4 @@
1
- import { ContainerModule } from '@theia/core/shared/inversify';
2
- declare const _default: ContainerModule;
3
- export default _default;
1
+ import { ContainerModule } from '@theia/core/shared/inversify';
2
+ declare const _default: ContainerModule;
3
+ export default _default;
4
4
  //# sourceMappingURL=metrics-frontend-module.d.ts.map
@@ -1,29 +1,29 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 STMicroelectronics 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 inversify_1 = require("@theia/core/shared/inversify");
19
- const metrics_frontend_application_contribution_1 = require("./metrics-frontend-application-contribution");
20
- const common_1 = require("../common");
21
- const browser_1 = require("@theia/core/lib/browser");
22
- exports.default = new inversify_1.ContainerModule(bind => {
23
- bind(browser_1.FrontendApplicationContribution).to(metrics_frontend_application_contribution_1.MetricsFrontendApplicationContribution).inSingletonScope();
24
- bind(common_1.MeasurementNotificationService).toDynamicValue(ctx => {
25
- const connection = ctx.container.get(browser_1.WebSocketConnectionProvider);
26
- return connection.createProxy(common_1.measurementNotificationServicePath);
27
- });
28
- });
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 STMicroelectronics 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 inversify_1 = require("@theia/core/shared/inversify");
19
+ const metrics_frontend_application_contribution_1 = require("./metrics-frontend-application-contribution");
20
+ const common_1 = require("../common");
21
+ const browser_1 = require("@theia/core/lib/browser");
22
+ exports.default = new inversify_1.ContainerModule(bind => {
23
+ bind(browser_1.FrontendApplicationContribution).to(metrics_frontend_application_contribution_1.MetricsFrontendApplicationContribution).inSingletonScope();
24
+ bind(common_1.MeasurementNotificationService).toDynamicValue(ctx => {
25
+ const connection = ctx.container.get(browser_1.WebSocketConnectionProvider);
26
+ return connection.createProxy(common_1.measurementNotificationServicePath);
27
+ });
28
+ });
29
29
  //# sourceMappingURL=metrics-frontend-module.js.map
@@ -1,2 +1,2 @@
1
- export * from './measurement-notification-service';
1
+ export * from './measurement-notification-service';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,29 +1,29 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 STMicroelectronics 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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
- }) : (function(o, m, k, k2) {
21
- if (k2 === undefined) k2 = k;
22
- o[k2] = m[k];
23
- }));
24
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
- };
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- __exportStar(require("./measurement-notification-service"), exports);
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 STMicroelectronics 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ __exportStar(require("./measurement-notification-service"), exports);
29
29
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
- import { MeasurementResult } from '@theia/core';
2
- export declare const measurementNotificationServicePath = "/services/measurement-notification";
3
- export declare const MeasurementNotificationService: unique symbol;
4
- export interface MeasurementNotificationService {
5
- /**
6
- * Notify the backend when a fronted stopwatch provides a new measurement.
7
- * @param frontendId The unique id associated with the frontend that sends the notification
8
- * @param result The new measurement result
9
- */
10
- onFrontendMeasurement(frontendId: string, result: MeasurementResult): void;
11
- }
1
+ import { MeasurementResult } from '@theia/core';
2
+ export declare const measurementNotificationServicePath = "/services/measurement-notification";
3
+ export declare const MeasurementNotificationService: unique symbol;
4
+ export interface MeasurementNotificationService {
5
+ /**
6
+ * Notify the backend when a fronted stopwatch provides a new measurement.
7
+ * @param frontendId The unique id associated with the frontend that sends the notification
8
+ * @param result The new measurement result
9
+ */
10
+ onFrontendMeasurement(frontendId: string, result: MeasurementResult): void;
11
+ }
12
12
  //# sourceMappingURL=measurement-notification-service.d.ts.map
@@ -1,21 +1,21 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 STMicroelectronics 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.MeasurementNotificationService = exports.measurementNotificationServicePath = void 0;
19
- exports.measurementNotificationServicePath = '/services/measurement-notification';
20
- exports.MeasurementNotificationService = Symbol('MeasurementNotificationService');
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2023 STMicroelectronics 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.MeasurementNotificationService = exports.measurementNotificationServicePath = void 0;
19
+ exports.measurementNotificationServicePath = '/services/measurement-notification';
20
+ exports.MeasurementNotificationService = Symbol('MeasurementNotificationService');
21
21
  //# sourceMappingURL=measurement-notification-service.js.map
@@ -1,9 +1,9 @@
1
- import { MetricsContribution } from './metrics-contribution';
2
- import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
3
- export declare class ExtensionMetricsContribution implements MetricsContribution {
4
- private metrics;
5
- protected readonly applicationPackage: ApplicationPackage;
6
- getMetrics(): string;
7
- startCollecting(): void;
8
- }
1
+ import { MetricsContribution } from './metrics-contribution';
2
+ import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
3
+ export declare class ExtensionMetricsContribution implements MetricsContribution {
4
+ private metrics;
5
+ protected readonly applicationPackage: ApplicationPackage;
6
+ getMetrics(): string;
7
+ startCollecting(): void;
8
+ }
9
9
  //# sourceMappingURL=extensions-metrics-contribution.d.ts.map
@@ -1,63 +1,63 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ExtensionMetricsContribution = void 0;
13
- // *****************************************************************************
14
- // Copyright (C) 2018 Ericsson and others.
15
- //
16
- // This program and the accompanying materials are made available under the
17
- // terms of the Eclipse Public License v. 2.0 which is available at
18
- // http://www.eclipse.org/legal/epl-2.0.
19
- //
20
- // This Source Code may also be made available under the following Secondary
21
- // Licenses when the conditions for such availability set forth in the Eclipse
22
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
- // with the GNU Classpath Exception which is available at
24
- // https://www.gnu.org/software/classpath/license.html.
25
- //
26
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
27
- // *****************************************************************************
28
- const inversify_1 = require("@theia/core/shared/inversify");
29
- const application_package_1 = require("@theia/core/shared/@theia/application-package");
30
- const prometheus_1 = require("./prometheus");
31
- const metricsName = 'theia_extension_version';
32
- let ExtensionMetricsContribution = class ExtensionMetricsContribution {
33
- constructor() {
34
- this.metrics = '';
35
- }
36
- getMetrics() {
37
- return this.metrics;
38
- }
39
- startCollecting() {
40
- let latestMetrics = '';
41
- const installedExtensions = this.applicationPackage.extensionPackages;
42
- latestMetrics += `# HELP ${metricsName} Theia extension version info.\n`;
43
- latestMetrics += `# TYPE ${metricsName} gauge\n`;
44
- installedExtensions.forEach(extensionInfo => {
45
- let extensionName = extensionInfo.name;
46
- if (!prometheus_1.PROMETHEUS_REGEXP.test(extensionName)) {
47
- extensionName = (0, prometheus_1.toPrometheusValidName)(extensionName);
48
- }
49
- const metricsValue = metricsName + `{extension="${extensionName}",version="${extensionInfo.version}"} 1`;
50
- latestMetrics += metricsValue + '\n';
51
- });
52
- this.metrics = latestMetrics;
53
- }
54
- };
55
- __decorate([
56
- (0, inversify_1.inject)(application_package_1.ApplicationPackage),
57
- __metadata("design:type", application_package_1.ApplicationPackage)
58
- ], ExtensionMetricsContribution.prototype, "applicationPackage", void 0);
59
- ExtensionMetricsContribution = __decorate([
60
- (0, inversify_1.injectable)()
61
- ], ExtensionMetricsContribution);
62
- exports.ExtensionMetricsContribution = ExtensionMetricsContribution;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ExtensionMetricsContribution = void 0;
13
+ // *****************************************************************************
14
+ // Copyright (C) 2018 Ericsson and others.
15
+ //
16
+ // This program and the accompanying materials are made available under the
17
+ // terms of the Eclipse Public License v. 2.0 which is available at
18
+ // http://www.eclipse.org/legal/epl-2.0.
19
+ //
20
+ // This Source Code may also be made available under the following Secondary
21
+ // Licenses when the conditions for such availability set forth in the Eclipse
22
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ // with the GNU Classpath Exception which is available at
24
+ // https://www.gnu.org/software/classpath/license.html.
25
+ //
26
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
27
+ // *****************************************************************************
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const application_package_1 = require("@theia/core/shared/@theia/application-package");
30
+ const prometheus_1 = require("./prometheus");
31
+ const metricsName = 'theia_extension_version';
32
+ let ExtensionMetricsContribution = class ExtensionMetricsContribution {
33
+ constructor() {
34
+ this.metrics = '';
35
+ }
36
+ getMetrics() {
37
+ return this.metrics;
38
+ }
39
+ startCollecting() {
40
+ let latestMetrics = '';
41
+ const installedExtensions = this.applicationPackage.extensionPackages;
42
+ latestMetrics += `# HELP ${metricsName} Theia extension version info.\n`;
43
+ latestMetrics += `# TYPE ${metricsName} gauge\n`;
44
+ installedExtensions.forEach(extensionInfo => {
45
+ let extensionName = extensionInfo.name;
46
+ if (!prometheus_1.PROMETHEUS_REGEXP.test(extensionName)) {
47
+ extensionName = (0, prometheus_1.toPrometheusValidName)(extensionName);
48
+ }
49
+ const metricsValue = metricsName + `{extension="${extensionName}",version="${extensionInfo.version}"} 1`;
50
+ latestMetrics += metricsValue + '\n';
51
+ });
52
+ this.metrics = latestMetrics;
53
+ }
54
+ };
55
+ __decorate([
56
+ (0, inversify_1.inject)(application_package_1.ApplicationPackage),
57
+ __metadata("design:type", application_package_1.ApplicationPackage)
58
+ ], ExtensionMetricsContribution.prototype, "applicationPackage", void 0);
59
+ ExtensionMetricsContribution = __decorate([
60
+ (0, inversify_1.injectable)()
61
+ ], ExtensionMetricsContribution);
62
+ exports.ExtensionMetricsContribution = ExtensionMetricsContribution;
63
63
  //# sourceMappingURL=extensions-metrics-contribution.js.map
@@ -1,6 +1,6 @@
1
- export * from './metrics-backend-application-contribution';
2
- export * from './metrics-contribution';
3
- export * from './node-metrics-contribution';
4
- export * from './extensions-metrics-contribution';
5
- export * from './prometheus';
1
+ export * from './metrics-backend-application-contribution';
2
+ export * from './metrics-contribution';
3
+ export * from './node-metrics-contribution';
4
+ export * from './extensions-metrics-contribution';
5
+ export * from './prometheus';
6
6
  //# sourceMappingURL=index.d.ts.map