@theia/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.
- package/README.md +1 -1
- package/package.json +3 -3
- package/src/node/extensions-metrics-contribution.ts +3 -6
- package/lib/browser/metrics-frontend-application-contribution.d.ts +0 -13
- package/lib/browser/metrics-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/metrics-frontend-application-contribution.js +0 -59
- package/lib/browser/metrics-frontend-application-contribution.js.map +0 -1
- package/lib/browser/metrics-frontend-module.d.ts +0 -4
- package/lib/browser/metrics-frontend-module.d.ts.map +0 -1
- package/lib/browser/metrics-frontend-module.js +0 -29
- package/lib/browser/metrics-frontend-module.js.map +0 -1
- package/lib/common/index.d.ts +0 -2
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -20
- package/lib/common/index.js.map +0 -1
- package/lib/common/measurement-notification-service.d.ts +0 -12
- package/lib/common/measurement-notification-service.d.ts.map +0 -1
- package/lib/common/measurement-notification-service.js +0 -21
- package/lib/common/measurement-notification-service.js.map +0 -1
- package/lib/electron-node/electron-metrics-backend-module.d.ts +0 -4
- package/lib/electron-node/electron-metrics-backend-module.d.ts.map +0 -1
- package/lib/electron-node/electron-metrics-backend-module.js +0 -25
- package/lib/electron-node/electron-metrics-backend-module.js.map +0 -1
- package/lib/electron-node/electron-token-validator.d.ts +0 -10
- package/lib/electron-node/electron-token-validator.d.ts.map +0 -1
- package/lib/electron-node/electron-token-validator.js +0 -44
- package/lib/electron-node/electron-token-validator.js.map +0 -1
- package/lib/node/extensions-metrics-contribution.d.ts +0 -9
- package/lib/node/extensions-metrics-contribution.d.ts.map +0 -1
- package/lib/node/extensions-metrics-contribution.js +0 -55
- package/lib/node/extensions-metrics-contribution.js.map +0 -1
- package/lib/node/index.d.ts +0 -6
- package/lib/node/index.d.ts.map +0 -1
- package/lib/node/index.js +0 -24
- package/lib/node/index.js.map +0 -1
- package/lib/node/measurement-metrics-contribution.d.ts +0 -18
- package/lib/node/measurement-metrics-contribution.d.ts.map +0 -1
- package/lib/node/measurement-metrics-contribution.js +0 -76
- package/lib/node/measurement-metrics-contribution.js.map +0 -1
- package/lib/node/metrics-backend-application-contribution.d.ts +0 -18
- package/lib/node/metrics-backend-application-contribution.d.ts.map +0 -1
- package/lib/node/metrics-backend-application-contribution.js +0 -51
- package/lib/node/metrics-backend-application-contribution.js.map +0 -1
- package/lib/node/metrics-backend-module.d.ts +0 -4
- package/lib/node/metrics-backend-module.d.ts.map +0 -1
- package/lib/node/metrics-backend-module.js +0 -36
- package/lib/node/metrics-backend-module.js.map +0 -1
- package/lib/node/metrics-contribution.d.ts +0 -6
- package/lib/node/metrics-contribution.d.ts.map +0 -1
- package/lib/node/metrics-contribution.js +0 -20
- package/lib/node/metrics-contribution.js.map +0 -1
- package/lib/node/node-metrics-contribution.d.ts +0 -6
- package/lib/node/node-metrics-contribution.d.ts.map +0 -1
- package/lib/node/node-metrics-contribution.js +0 -36
- package/lib/node/node-metrics-contribution.js.map +0 -1
- package/lib/node/prometheus.d.ts +0 -3
- package/lib/node/prometheus.d.ts.map +0 -1
- package/lib/node/prometheus.js +0 -28
- package/lib/node/prometheus.js.map +0 -1
- package/lib/node/prometheus.spec.d.ts +0 -2
- package/lib/node/prometheus.spec.d.ts.map +0 -1
- package/lib/node/prometheus.spec.js +0 -41
- package/lib/node/prometheus.spec.js.map +0 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ The `@theia/metrics` extension provides metrics using the [Prometheus](https://p
|
|
|
16
16
|
|
|
17
17
|
## Additional Information
|
|
18
18
|
|
|
19
|
-
- [API documentation for `@theia/metrics`](https://eclipse-theia.github.io/theia/docs/next/modules/
|
|
19
|
+
- [API documentation for `@theia/metrics`](https://eclipse-theia.github.io/theia/docs/next/modules/_theia_metrics.html)
|
|
20
20
|
- [Theia - GitHub](https://github.com/eclipse-theia/theia)
|
|
21
21
|
- [Theia - Website](https://theia-ide.org/)
|
|
22
22
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theia/metrics",
|
|
3
|
-
"version": "1.67.0-next.
|
|
3
|
+
"version": "1.67.0-next.56+d8f18cc386c",
|
|
4
4
|
"description": "Theia - Metrics Extension",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@theia/core": "1.67.0-next.
|
|
6
|
+
"@theia/core": "1.67.0-next.56+d8f18cc386c",
|
|
7
7
|
"prom-client": "^10.2.0",
|
|
8
8
|
"tslib": "^2.6.2"
|
|
9
9
|
},
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"nyc": {
|
|
50
50
|
"extends": "../../configs/nyc.json"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d8f18cc386c45a736cd193d42eab02c8f64c6b10"
|
|
53
53
|
}
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
-
import { injectable
|
|
16
|
+
import { injectable } from '@theia/core/shared/inversify';
|
|
17
17
|
import { MetricsContribution } from './metrics-contribution';
|
|
18
|
-
import { ApplicationPackage } from '@theia/core/shared/@theia/application-package';
|
|
19
18
|
import { PROMETHEUS_REGEXP, toPrometheusValidName } from './prometheus';
|
|
20
19
|
|
|
21
20
|
const metricsName = 'theia_extension_version';
|
|
@@ -24,16 +23,14 @@ const metricsName = 'theia_extension_version';
|
|
|
24
23
|
export class ExtensionMetricsContribution implements MetricsContribution {
|
|
25
24
|
private metrics: string = '';
|
|
26
25
|
|
|
27
|
-
@inject(ApplicationPackage)
|
|
28
|
-
protected readonly applicationPackage: ApplicationPackage;
|
|
29
|
-
|
|
30
26
|
getMetrics(): string {
|
|
31
27
|
return this.metrics;
|
|
32
28
|
}
|
|
33
29
|
|
|
34
30
|
startCollecting(): void {
|
|
35
31
|
let latestMetrics = '';
|
|
36
|
-
|
|
32
|
+
// @ts-expect-error
|
|
33
|
+
const installedExtensions: ExtensionInfo[] = globalThis.extensionInfo;
|
|
37
34
|
latestMetrics += `# HELP ${metricsName} Theia extension version info.\n`;
|
|
38
35
|
latestMetrics += `# TYPE ${metricsName} gauge\n`;
|
|
39
36
|
installedExtensions.forEach(extensionInfo => {
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=metrics-frontend-application-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-frontend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/metrics-frontend-application-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAY,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE9E,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAE3D,qBACa,sCAAuC,YAAW,+BAA+B;IAE1F,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC;IAG/B,SAAS,CAAC,mBAAmB,EAAE,8BAA8B,CAAC;IAG9D,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAE1B,QAAQ,CAAC,EAAE,SAAgB;IAE3B,UAAU,IAAI,IAAI;cAIF,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAS7C,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAGpD"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetricsFrontendApplicationContribution = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// *****************************************************************************
|
|
6
|
-
// Copyright (C) 2023 STMicroelectronics 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 inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const core_1 = require("@theia/core");
|
|
22
|
-
const coreutils_1 = require("@theia/core/shared/@lumino/coreutils");
|
|
23
|
-
const common_1 = require("../common");
|
|
24
|
-
let MetricsFrontendApplicationContribution = class MetricsFrontendApplicationContribution {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.id = coreutils_1.UUID.uuid4();
|
|
27
|
-
}
|
|
28
|
-
initialize() {
|
|
29
|
-
this.doInitialize();
|
|
30
|
-
}
|
|
31
|
-
async doInitialize() {
|
|
32
|
-
const logLevel = await this.logger.getLogLevel();
|
|
33
|
-
if (logLevel !== core_1.LogLevel.DEBUG) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
this.stopwatch.storedMeasurements.forEach(result => this.notify(result));
|
|
37
|
-
this.stopwatch.onDidAddMeasurementResult(result => this.notify(result));
|
|
38
|
-
}
|
|
39
|
-
notify(result) {
|
|
40
|
-
this.notificationService.onFrontendMeasurement(this.id, result);
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.MetricsFrontendApplicationContribution = MetricsFrontendApplicationContribution;
|
|
44
|
-
tslib_1.__decorate([
|
|
45
|
-
(0, inversify_1.inject)(core_1.Stopwatch),
|
|
46
|
-
tslib_1.__metadata("design:type", core_1.Stopwatch)
|
|
47
|
-
], MetricsFrontendApplicationContribution.prototype, "stopwatch", void 0);
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, inversify_1.inject)(common_1.MeasurementNotificationService),
|
|
50
|
-
tslib_1.__metadata("design:type", Object)
|
|
51
|
-
], MetricsFrontendApplicationContribution.prototype, "notificationService", void 0);
|
|
52
|
-
tslib_1.__decorate([
|
|
53
|
-
(0, inversify_1.inject)(core_1.ILogger),
|
|
54
|
-
tslib_1.__metadata("design:type", Object)
|
|
55
|
-
], MetricsFrontendApplicationContribution.prototype, "logger", void 0);
|
|
56
|
-
exports.MetricsFrontendApplicationContribution = MetricsFrontendApplicationContribution = tslib_1.__decorate([
|
|
57
|
-
(0, inversify_1.injectable)()
|
|
58
|
-
], MetricsFrontendApplicationContribution);
|
|
59
|
-
//# sourceMappingURL=metrics-frontend-application-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-frontend-application-contribution.js","sourceRoot":"","sources":["../../src/browser/metrics-frontend-application-contribution.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAAkE;AAElE,sCAA8E;AAC9E,oEAA4D;AAC5D,sCAA2D;AAGpD,IAAM,sCAAsC,GAA5C,MAAM,sCAAsC;IAA5C;QAUM,OAAE,GAAG,gBAAI,CAAC,KAAK,EAAE,CAAC;IAkB/B,CAAC;IAhBG,UAAU;QACN,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAES,KAAK,CAAC,YAAY;QACxB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;QACjD,IAAI,QAAQ,KAAK,eAAQ,CAAC,KAAK,EAAE,CAAC;YAC9B,OAAO;QACX,CAAC;QACD,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QACzE,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5E,CAAC;IAES,MAAM,CAAC,MAAyB;QACtC,IAAI,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;CACJ,CAAA;AA5BY,wFAAsC;AAErC;IADT,IAAA,kBAAM,EAAC,gBAAS,CAAC;sCACG,gBAAS;yEAAC;AAGrB;IADT,IAAA,kBAAM,EAAC,uCAA8B,CAAC;;mFACuB;AAGpD;IADT,IAAA,kBAAM,EAAC,cAAO,CAAC;;sEACU;iDARjB,sCAAsC;IADlD,IAAA,sBAAU,GAAE;GACA,sCAAsC,CA4BlD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/metrics-frontend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAK/D,wBAMG"}
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
}).inSingletonScope();
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=metrics-frontend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-frontend-module.js","sourceRoot":"","sources":["../../src/browser/metrics-frontend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAA+D;AAC/D,2GAAqG;AACrG,sCAA+F;AAC/F,qDAAuG;AAEvG,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAI,CAAC,yCAA+B,CAAC,CAAC,EAAE,CAAC,kFAAsC,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpG,IAAI,CAAC,uCAA8B,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;QACtD,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,qCAA2B,CAAC,CAAC;QAClE,OAAO,UAAU,CAAC,WAAW,CAAiC,2CAAkC,CAAC,CAAC;IACtG,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
package/lib/common/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAgBA,cAAc,oCAAoC,CAAC"}
|
package/lib/common/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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 tslib_1 = require("tslib");
|
|
19
|
-
tslib_1.__exportStar(require("./measurement-notification-service"), exports);
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/lib/common/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,6EAAmD"}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=measurement-notification-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement-notification-service.d.ts","sourceRoot":"","sources":["../../src/common/measurement-notification-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,kCAAkC,uCAAuC,CAAC;AAEvF,eAAO,MAAM,8BAA8B,eAA2C,CAAC;AACvF,MAAM,WAAW,8BAA8B;IAC3C;;;;OAIG;IACH,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC9E"}
|
|
@@ -1,21 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=measurement-notification-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement-notification-service.js","sourceRoot":"","sources":["../../src/common/measurement-notification-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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;;;AAInE,QAAA,kCAAkC,GAAG,oCAAoC,CAAC;AAE1E,QAAA,8BAA8B,GAAG,MAAM,CAAC,gCAAgC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron-metrics-backend-module.d.ts","sourceRoot":"","sources":["../../src/electron-node/electron-metrics-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAI/D,wBAGG"}
|
|
@@ -1,25 +0,0 @@
|
|
|
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 electron_token_validator_1 = require("./electron-token-validator");
|
|
20
|
-
const electron_token_validator_2 = require("@theia/core/lib/electron-node/token/electron-token-validator");
|
|
21
|
-
exports.default = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
22
|
-
bind(electron_token_validator_1.MetricsElectronTokenValidator).toSelf().inSingletonScope();
|
|
23
|
-
rebind(electron_token_validator_2.ElectronTokenValidator).to(electron_token_validator_1.MetricsElectronTokenValidator);
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=electron-metrics-backend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron-metrics-backend-module.js","sourceRoot":"","sources":["../../src/electron-node/electron-metrics-backend-module.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAA+D;AAC/D,yEAA2E;AAC3E,2GAAsG;AAEtG,kBAAe,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACjE,IAAI,CAAC,wDAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,MAAM,CAAC,iDAAsB,CAAC,CAAC,EAAE,CAAC,wDAA6B,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ElectronTokenValidator } from '@theia/core/lib/electron-node/token/electron-token-validator';
|
|
3
|
-
import { IncomingMessage } from 'http';
|
|
4
|
-
import { MaybePromise } from '@theia/core';
|
|
5
|
-
export declare class MetricsElectronTokenValidator extends ElectronTokenValidator {
|
|
6
|
-
protected init(): void;
|
|
7
|
-
allowWsUpgrade(request: IncomingMessage): MaybePromise<boolean>;
|
|
8
|
-
allowRequest(request: IncomingMessage): boolean;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=electron-token-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron-token-validator.d.ts","sourceRoot":"","sources":["../../src/electron-node/electron-token-validator.ts"],"names":[],"mappings":";AAiBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAC;AACtG,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,qBACa,6BAA8B,SAAQ,sBAAsB;cAElD,IAAI,IAAI,IAAI;IAItB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,YAAY,CAAC,OAAO,CAAC;IAI/D,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO;CAG3D"}
|
|
@@ -1,44 +0,0 @@
|
|
|
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.MetricsElectronTokenValidator = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const electron_token_validator_1 = require("@theia/core/lib/electron-node/token/electron-token-validator");
|
|
22
|
-
const metrics_backend_application_contribution_1 = require("../node/metrics-backend-application-contribution");
|
|
23
|
-
let MetricsElectronTokenValidator = class MetricsElectronTokenValidator extends electron_token_validator_1.ElectronTokenValidator {
|
|
24
|
-
init() {
|
|
25
|
-
super.init();
|
|
26
|
-
}
|
|
27
|
-
allowWsUpgrade(request) {
|
|
28
|
-
return this.allowRequest(request);
|
|
29
|
-
}
|
|
30
|
-
allowRequest(request) {
|
|
31
|
-
return request.url === metrics_backend_application_contribution_1.MetricsBackendApplicationContribution.ENDPOINT || super.allowRequest(request);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.MetricsElectronTokenValidator = MetricsElectronTokenValidator;
|
|
35
|
-
tslib_1.__decorate([
|
|
36
|
-
(0, inversify_1.postConstruct)(),
|
|
37
|
-
tslib_1.__metadata("design:type", Function),
|
|
38
|
-
tslib_1.__metadata("design:paramtypes", []),
|
|
39
|
-
tslib_1.__metadata("design:returntype", void 0)
|
|
40
|
-
], MetricsElectronTokenValidator.prototype, "init", null);
|
|
41
|
-
exports.MetricsElectronTokenValidator = MetricsElectronTokenValidator = tslib_1.__decorate([
|
|
42
|
-
(0, inversify_1.injectable)()
|
|
43
|
-
], MetricsElectronTokenValidator);
|
|
44
|
-
//# sourceMappingURL=electron-token-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"electron-token-validator.js","sourceRoot":"","sources":["../../src/electron-node/electron-token-validator.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAAyE;AACzE,2GAAsG;AAEtG,+GAAyG;AAIlG,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,iDAAsB;IAElD,IAAI;QACnB,KAAK,CAAC,IAAI,EAAE,CAAC;IACjB,CAAC;IAEQ,cAAc,CAAC,OAAwB;QAC5C,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAEQ,YAAY,CAAC,OAAwB;QAC1C,OAAO,OAAO,CAAC,GAAG,KAAK,gFAAqC,CAAC,QAAQ,IAAI,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IACzG,CAAC;CACJ,CAAA;AAbY,sEAA6B;AAEnB;IADlB,IAAA,yBAAa,GAAE;;;;yDAGf;wCAJQ,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CAazC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=extensions-metrics-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions-metrics-contribution.d.ts","sourceRoot":"","sources":["../../src/node/extensions-metrics-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAKnF,qBACa,4BAA6B,YAAW,mBAAmB;IACpE,OAAO,CAAC,OAAO,CAAc;IAG7B,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;IAE1D,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,IAAI;CAiB1B"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExtensionMetricsContribution = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// *****************************************************************************
|
|
6
|
-
// Copyright (C) 2018 Ericsson 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 inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const application_package_1 = require("@theia/core/shared/@theia/application-package");
|
|
22
|
-
const prometheus_1 = require("./prometheus");
|
|
23
|
-
const metricsName = 'theia_extension_version';
|
|
24
|
-
let ExtensionMetricsContribution = class ExtensionMetricsContribution {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.metrics = '';
|
|
27
|
-
}
|
|
28
|
-
getMetrics() {
|
|
29
|
-
return this.metrics;
|
|
30
|
-
}
|
|
31
|
-
startCollecting() {
|
|
32
|
-
let latestMetrics = '';
|
|
33
|
-
const installedExtensions = this.applicationPackage.extensionPackages;
|
|
34
|
-
latestMetrics += `# HELP ${metricsName} Theia extension version info.\n`;
|
|
35
|
-
latestMetrics += `# TYPE ${metricsName} gauge\n`;
|
|
36
|
-
installedExtensions.forEach(extensionInfo => {
|
|
37
|
-
let extensionName = extensionInfo.name;
|
|
38
|
-
if (!prometheus_1.PROMETHEUS_REGEXP.test(extensionName)) {
|
|
39
|
-
extensionName = (0, prometheus_1.toPrometheusValidName)(extensionName);
|
|
40
|
-
}
|
|
41
|
-
const metricsValue = metricsName + `{extension="${extensionName}",version="${extensionInfo.version}"} 1`;
|
|
42
|
-
latestMetrics += metricsValue + '\n';
|
|
43
|
-
});
|
|
44
|
-
this.metrics = latestMetrics;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
exports.ExtensionMetricsContribution = ExtensionMetricsContribution;
|
|
48
|
-
tslib_1.__decorate([
|
|
49
|
-
(0, inversify_1.inject)(application_package_1.ApplicationPackage),
|
|
50
|
-
tslib_1.__metadata("design:type", application_package_1.ApplicationPackage)
|
|
51
|
-
], ExtensionMetricsContribution.prototype, "applicationPackage", void 0);
|
|
52
|
-
exports.ExtensionMetricsContribution = ExtensionMetricsContribution = tslib_1.__decorate([
|
|
53
|
-
(0, inversify_1.injectable)()
|
|
54
|
-
], ExtensionMetricsContribution);
|
|
55
|
-
//# sourceMappingURL=extensions-metrics-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extensions-metrics-contribution.js","sourceRoot":"","sources":["../../src/node/extensions-metrics-contribution.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,4DAAkE;AAElE,uFAAmF;AACnF,6CAAwE;AAExE,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAGvC,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAAlC;QACK,YAAO,GAAW,EAAE,CAAC;IA0BjC,CAAC;IArBG,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,eAAe;QACX,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,MAAM,mBAAmB,GAAG,IAAI,CAAC,kBAAkB,CAAC,iBAAiB,CAAC;QACtE,aAAa,IAAI,UAAU,WAAW,kCAAkC,CAAC;QACzE,aAAa,IAAI,UAAU,WAAW,UAAU,CAAC;QACjD,mBAAmB,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE;YACxC,IAAI,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC;YACvC,IAAI,CAAC,8BAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBACzC,aAAa,GAAG,IAAA,kCAAqB,EAAC,aAAa,CAAC,CAAC;YACzD,CAAC;YAED,MAAM,YAAY,GAAG,WAAW,GAAG,eAAe,aAAa,cAAc,aAAa,CAAC,OAAO,MAAM,CAAC;YACzG,aAAa,IAAI,YAAY,GAAG,IAAI,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG,aAAa,CAAC;IACjC,CAAC;CACJ,CAAA;AA3BY,oEAA4B;AAIlB;IADlB,IAAA,kBAAM,EAAC,wCAAkB,CAAC;sCACY,wCAAkB;wEAAC;uCAJjD,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA2BxC"}
|
package/lib/node/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
-
//# sourceMappingURL=index.d.ts.map
|
package/lib/node/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAgBA,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mCAAmC,CAAC;AAClD,cAAc,cAAc,CAAC"}
|
package/lib/node/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Ericsson 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 tslib_1 = require("tslib");
|
|
19
|
-
tslib_1.__exportStar(require("./metrics-backend-application-contribution"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./metrics-contribution"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./node-metrics-contribution"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./extensions-metrics-contribution"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./prometheus"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/lib/node/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,qFAA2D;AAC3D,iEAAuC;AACvC,sEAA4C;AAC5C,4EAAkD;AAClD,uDAA6B"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { MetricsContribution } from './metrics-contribution';
|
|
2
|
-
import { MeasurementResult, Stopwatch } from '@theia/core';
|
|
3
|
-
import { MeasurementNotificationService } from '../common';
|
|
4
|
-
import { LogLevelCliContribution } from '@theia/core/lib/node/logger-cli-contribution';
|
|
5
|
-
export declare class MeasurementMetricsBackendContribution implements MetricsContribution, MeasurementNotificationService {
|
|
6
|
-
protected backendStopwatch: Stopwatch;
|
|
7
|
-
protected logLevelCli: LogLevelCliContribution;
|
|
8
|
-
protected metrics: string;
|
|
9
|
-
protected frontendCounters: Map<string, string>;
|
|
10
|
-
startCollecting(): void;
|
|
11
|
-
getMetrics(): string;
|
|
12
|
-
protected appendMetricsValue(id: string, result: MeasurementResult): void;
|
|
13
|
-
protected onBackendMeasurement(result: MeasurementResult): void;
|
|
14
|
-
protected createFrontendCounterId(frontendId: string): string;
|
|
15
|
-
protected toCounterId(frontendId: string): string;
|
|
16
|
-
onFrontendMeasurement(frontendId: string, result: MeasurementResult): void;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=measurement-metrics-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement-metrics-contribution.d.ts","sourceRoot":"","sources":["../../src/node/measurement-metrics-contribution.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAY,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAKvF,qBACa,qCAAsC,YAAW,mBAAmB,EAAE,8BAA8B;IAE7G,SAAS,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAGtC,SAAS,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAE/C,SAAS,CAAC,OAAO,SAAM;IACvB,SAAS,CAAC,gBAAgB,sBAA6B;IAEvD,eAAe,IAAI,IAAI;IAUvB,UAAU,IAAI,MAAM;IAIpB,SAAS,CAAC,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAOzE,SAAS,CAAC,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAI/D,SAAS,CAAC,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAM7D,SAAS,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAIjD,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,IAAI;CAI7E"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MeasurementMetricsBackendContribution = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// *****************************************************************************
|
|
6
|
-
// Copyright (C) 2023 STMicroelectronics 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 inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const core_1 = require("@theia/core");
|
|
22
|
-
const logger_cli_contribution_1 = require("@theia/core/lib/node/logger-cli-contribution");
|
|
23
|
-
const backendId = 'backend';
|
|
24
|
-
const metricsName = 'theia_measurements';
|
|
25
|
-
let MeasurementMetricsBackendContribution = class MeasurementMetricsBackendContribution {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.metrics = '';
|
|
28
|
-
this.frontendCounters = new Map();
|
|
29
|
-
}
|
|
30
|
-
startCollecting() {
|
|
31
|
-
if (this.logLevelCli.defaultLogLevel !== core_1.LogLevel.DEBUG) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
this.metrics += `# HELP ${metricsName} Theia stopwatch measurement results.\n`;
|
|
35
|
-
this.metrics += `# TYPE ${metricsName} gauge\n`;
|
|
36
|
-
this.backendStopwatch.storedMeasurements.forEach(result => this.onBackendMeasurement(result));
|
|
37
|
-
this.backendStopwatch.onDidAddMeasurementResult(result => this.onBackendMeasurement(result));
|
|
38
|
-
}
|
|
39
|
-
getMetrics() {
|
|
40
|
-
return this.metrics;
|
|
41
|
-
}
|
|
42
|
-
appendMetricsValue(id, result) {
|
|
43
|
-
const { name, elapsed, startTime, owner } = result;
|
|
44
|
-
const labels = `id="${id}", name="${name}", startTime="${startTime}", owner="${owner}"`;
|
|
45
|
-
const metricsValue = `${metricsName}{${labels}} ${elapsed}`;
|
|
46
|
-
this.metrics += (metricsValue + '\n');
|
|
47
|
-
}
|
|
48
|
-
onBackendMeasurement(result) {
|
|
49
|
-
this.appendMetricsValue(backendId, result);
|
|
50
|
-
}
|
|
51
|
-
createFrontendCounterId(frontendId) {
|
|
52
|
-
const counterId = `frontend-${this.frontendCounters.size + 1}`;
|
|
53
|
-
this.frontendCounters.set(frontendId, counterId);
|
|
54
|
-
return counterId;
|
|
55
|
-
}
|
|
56
|
-
toCounterId(frontendId) {
|
|
57
|
-
var _a;
|
|
58
|
-
return (_a = this.frontendCounters.get(frontendId)) !== null && _a !== void 0 ? _a : this.createFrontendCounterId(frontendId);
|
|
59
|
-
}
|
|
60
|
-
onFrontendMeasurement(frontendId, result) {
|
|
61
|
-
this.appendMetricsValue(this.toCounterId(frontendId), result);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.MeasurementMetricsBackendContribution = MeasurementMetricsBackendContribution;
|
|
65
|
-
tslib_1.__decorate([
|
|
66
|
-
(0, inversify_1.inject)(core_1.Stopwatch),
|
|
67
|
-
tslib_1.__metadata("design:type", core_1.Stopwatch)
|
|
68
|
-
], MeasurementMetricsBackendContribution.prototype, "backendStopwatch", void 0);
|
|
69
|
-
tslib_1.__decorate([
|
|
70
|
-
(0, inversify_1.inject)(logger_cli_contribution_1.LogLevelCliContribution),
|
|
71
|
-
tslib_1.__metadata("design:type", logger_cli_contribution_1.LogLevelCliContribution)
|
|
72
|
-
], MeasurementMetricsBackendContribution.prototype, "logLevelCli", void 0);
|
|
73
|
-
exports.MeasurementMetricsBackendContribution = MeasurementMetricsBackendContribution = tslib_1.__decorate([
|
|
74
|
-
(0, inversify_1.injectable)()
|
|
75
|
-
], MeasurementMetricsBackendContribution);
|
|
76
|
-
//# sourceMappingURL=measurement-metrics-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"measurement-metrics-contribution.js","sourceRoot":"","sources":["../../src/node/measurement-metrics-contribution.ts"],"names":[],"mappings":";;;;AAAA,gFAAgF;AAChF,oDAAoD;AACpD,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,4DAAmE;AAEnE,sCAAqE;AAErE,0FAAuF;AAEvF,MAAM,SAAS,GAAG,SAAS,CAAC;AAC5B,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAGlC,IAAM,qCAAqC,GAA3C,MAAM,qCAAqC;IAA3C;QAOO,YAAO,GAAG,EAAE,CAAC;QACb,qBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAyC3D,CAAC;IAvCG,eAAe;QACX,IAAI,IAAI,CAAC,WAAW,CAAC,eAAe,KAAK,eAAQ,CAAC,KAAK,EAAE,CAAC;YACtD,OAAO;QACX,CAAC;QACD,IAAI,CAAC,OAAO,IAAI,UAAU,WAAW,yCAAyC,CAAC;QAC/E,IAAI,CAAC,OAAO,IAAI,UAAU,WAAW,UAAU,CAAC;QAChD,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9F,IAAI,CAAC,gBAAgB,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC;IACjG,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAES,kBAAkB,CAAC,EAAU,EAAE,MAAyB;QAC9D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;QACnD,MAAM,MAAM,GAAW,OAAO,EAAE,YAAY,IAAI,iBAAiB,SAAS,aAAa,KAAK,GAAG,CAAC;QAChG,MAAM,YAAY,GAAG,GAAG,WAAW,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QAC5D,IAAI,CAAC,OAAO,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC1C,CAAC;IAES,oBAAoB,CAAC,MAAyB;QACpD,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAES,uBAAuB,CAAC,UAAkB;QAChD,MAAM,SAAS,GAAG,YAAY,IAAI,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC/D,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QACjD,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,WAAW,CAAC,UAAkB;;QACpC,OAAO,MAAA,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,UAAU,CAAC,mCAAI,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;IAC7F,CAAC;IAED,qBAAqB,CAAC,UAAkB,EAAE,MAAyB;QAC/D,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CAEJ,CAAA;AAjDY,sFAAqC;AAEpC;IADT,IAAA,kBAAM,EAAC,gBAAS,CAAC;sCACU,gBAAS;+EAAC;AAG5B;IADT,IAAA,kBAAM,EAAC,iDAAuB,CAAC;sCACT,iDAAuB;0EAAC;gDALtC,qCAAqC;IADjD,IAAA,sBAAU,GAAE;GACA,qCAAqC,CAiDjD"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference types="express" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
import * as http from 'http';
|
|
5
|
-
import * as https from 'https';
|
|
6
|
-
import * as express from '@theia/core/shared/express';
|
|
7
|
-
import { ContributionProvider } from '@theia/core/lib/common';
|
|
8
|
-
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
9
|
-
import { MetricsContribution } from './metrics-contribution';
|
|
10
|
-
export declare class MetricsBackendApplicationContribution implements BackendApplicationContribution {
|
|
11
|
-
protected readonly metricsProviders: ContributionProvider<MetricsContribution>;
|
|
12
|
-
static ENDPOINT: string;
|
|
13
|
-
constructor(metricsProviders: ContributionProvider<MetricsContribution>);
|
|
14
|
-
configure(app: express.Application): void;
|
|
15
|
-
onStart(server: http.Server | https.Server): void;
|
|
16
|
-
fetchMetricsFromProviders(): string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=metrics-backend-application-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-backend-application-contribution.d.ts","sourceRoot":"","sources":["../../src/node/metrics-backend-application-contribution.ts"],"names":[],"mappings":";;;AAiBA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,qBACa,qCAAsC,YAAW,8BAA8B;IAIpF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC;IAHlF,MAAM,CAAC,QAAQ,SAAc;gBAGN,gBAAgB,EAAE,oBAAoB,CAAC,mBAAmB,CAAC;IAIlF,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,GAAG,IAAI;IAOzC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI;IAMjD,yBAAyB,IAAI,MAAM;CAItC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017-2018 Ericsson 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 MetricsBackendApplicationContribution_1;
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.MetricsBackendApplicationContribution = void 0;
|
|
20
|
-
const tslib_1 = require("tslib");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const common_1 = require("@theia/core/lib/common");
|
|
23
|
-
const metrics_contribution_1 = require("./metrics-contribution");
|
|
24
|
-
let MetricsBackendApplicationContribution = MetricsBackendApplicationContribution_1 = class MetricsBackendApplicationContribution {
|
|
25
|
-
constructor(metricsProviders) {
|
|
26
|
-
this.metricsProviders = metricsProviders;
|
|
27
|
-
}
|
|
28
|
-
configure(app) {
|
|
29
|
-
app.get(MetricsBackendApplicationContribution_1.ENDPOINT, (req, res) => {
|
|
30
|
-
const lastMetrics = this.fetchMetricsFromProviders();
|
|
31
|
-
res.send(lastMetrics);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
onStart(server) {
|
|
35
|
-
this.metricsProviders.getContributions().forEach(contribution => {
|
|
36
|
-
contribution.startCollecting();
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
fetchMetricsFromProviders() {
|
|
40
|
-
return this.metricsProviders.getContributions().reduce((total, contribution) => total += contribution.getMetrics() + '\n', '');
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.MetricsBackendApplicationContribution = MetricsBackendApplicationContribution;
|
|
44
|
-
MetricsBackendApplicationContribution.ENDPOINT = '/metrics';
|
|
45
|
-
exports.MetricsBackendApplicationContribution = MetricsBackendApplicationContribution = MetricsBackendApplicationContribution_1 = tslib_1.__decorate([
|
|
46
|
-
(0, inversify_1.injectable)(),
|
|
47
|
-
tslib_1.__param(0, (0, inversify_1.inject)(common_1.ContributionProvider)),
|
|
48
|
-
tslib_1.__param(0, (0, inversify_1.named)(metrics_contribution_1.MetricsContribution)),
|
|
49
|
-
tslib_1.__metadata("design:paramtypes", [Object])
|
|
50
|
-
], MetricsBackendApplicationContribution);
|
|
51
|
-
//# sourceMappingURL=metrics-backend-application-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-backend-application-contribution.js","sourceRoot":"","sources":["../../src/node/metrics-backend-application-contribution.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,4DAAyE;AAIzE,mDAA8D;AAE9D,iEAA6D;AAGtD,IAAM,qCAAqC,6CAA3C,MAAM,qCAAqC;IAE9C,YAEuB,gBAA2D;QAA3D,qBAAgB,GAAhB,gBAAgB,CAA2C;IAElF,CAAC;IAED,SAAS,CAAC,GAAwB;QAC9B,GAAG,CAAC,GAAG,CAAC,uCAAqC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YACjE,MAAM,WAAW,GAAG,IAAI,CAAC,yBAAyB,EAAE,CAAC;YACrD,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IAED,OAAO,CAAC,MAAkC;QACtC,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;YAC5D,YAAY,CAAC,eAAe,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC;IAED,yBAAyB;QACrB,OAAO,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,CAC3E,KAAK,IAAI,YAAY,CAAC,UAAU,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC;IACvD,CAAC;;AAxBQ,sFAAqC;AACvC,8CAAQ,GAAG,UAAU,AAAb,CAAc;gDADpB,qCAAqC;IADjD,IAAA,sBAAU,GAAE;IAIJ,mBAAA,IAAA,kBAAM,EAAC,6BAAoB,CAAC,CAAA;IAAE,mBAAA,IAAA,iBAAK,EAAC,0CAAmB,CAAC,CAAA;;GAHpD,qCAAqC,CAyBjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-backend-module.d.ts","sourceRoot":"","sources":["../../src/node/metrics-backend-module.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;;AAU/D,wBAaG"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2017-2018 Ericsson 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 node_1 = require("@theia/core/lib/node");
|
|
20
|
-
const common_1 = require("@theia/core/lib/common");
|
|
21
|
-
const metrics_contribution_1 = require("./metrics-contribution");
|
|
22
|
-
const node_metrics_contribution_1 = require("./node-metrics-contribution");
|
|
23
|
-
const extensions_metrics_contribution_1 = require("./extensions-metrics-contribution");
|
|
24
|
-
const metrics_backend_application_contribution_1 = require("./metrics-backend-application-contribution");
|
|
25
|
-
const common_2 = require("../common");
|
|
26
|
-
const measurement_metrics_contribution_1 = require("./measurement-metrics-contribution");
|
|
27
|
-
exports.default = new inversify_1.ContainerModule(bind => {
|
|
28
|
-
(0, common_1.bindContributionProvider)(bind, metrics_contribution_1.MetricsContribution);
|
|
29
|
-
bind(metrics_contribution_1.MetricsContribution).to(node_metrics_contribution_1.NodeMetricsContribution).inSingletonScope();
|
|
30
|
-
bind(metrics_contribution_1.MetricsContribution).to(extensions_metrics_contribution_1.ExtensionMetricsContribution).inSingletonScope();
|
|
31
|
-
bind(measurement_metrics_contribution_1.MeasurementMetricsBackendContribution).toSelf().inSingletonScope();
|
|
32
|
-
bind(metrics_contribution_1.MetricsContribution).toService(measurement_metrics_contribution_1.MeasurementMetricsBackendContribution);
|
|
33
|
-
bind(common_1.ConnectionHandler).toDynamicValue(ctx => new common_1.RpcConnectionHandler(common_2.measurementNotificationServicePath, () => ctx.container.get(measurement_metrics_contribution_1.MeasurementMetricsBackendContribution)));
|
|
34
|
-
bind(node_1.BackendApplicationContribution).to(metrics_backend_application_contribution_1.MetricsBackendApplicationContribution).inSingletonScope();
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=metrics-backend-module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-backend-module.js","sourceRoot":"","sources":["../../src/node/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,4DAA+D;AAC/D,+CAAsE;AACtE,mDAA2G;AAC3G,iEAA6D;AAC7D,2EAAsE;AACtE,uFAAiF;AACjF,yGAAmG;AACnG,sCAA+D;AAC/D,yFAA2F;AAE3F,kBAAe,IAAI,2BAAe,CAAC,IAAI,CAAC,EAAE;IACtC,IAAA,iCAAwB,EAAC,IAAI,EAAE,0CAAmB,CAAC,CAAC;IACpD,IAAI,CAAC,0CAAmB,CAAC,CAAC,EAAE,CAAC,mDAAuB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACzE,IAAI,CAAC,0CAAmB,CAAC,CAAC,EAAE,CAAC,8DAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAE9E,IAAI,CAAC,wEAAqC,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxE,IAAI,CAAC,0CAAmB,CAAC,CAAC,SAAS,CAAC,wEAAqC,CAAC,CAAC;IAC3E,IAAI,CAAC,0BAAiB,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,CACzC,IAAI,6BAAoB,CAAC,2CAAkC,EACvD,GAAG,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,wEAAqC,CAAC,CAAC,CAAC,CAAC;IAEzE,IAAI,CAAC,qCAA8B,CAAC,CAAC,EAAE,CAAC,gFAAqC,CAAC,CAAC,gBAAgB,EAAE,CAAC;AAEtG,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-contribution.d.ts","sourceRoot":"","sources":["../../src/node/metrics-contribution.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,MAAM,WAAW,mBAAmB;IAChC,eAAe,IAAI,IAAI,CAAC;IACxB,UAAU,IAAI,MAAM,CAAC;CACxB"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetricsContribution = void 0;
|
|
4
|
-
// *****************************************************************************
|
|
5
|
-
// Copyright (C) 2018 Ericsson and others.
|
|
6
|
-
//
|
|
7
|
-
// This program and the accompanying materials are made available under the
|
|
8
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
-
//
|
|
11
|
-
// This Source Code may also be made available under the following Secondary
|
|
12
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
-
// with the GNU Classpath Exception which is available at
|
|
15
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
16
|
-
//
|
|
17
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
18
|
-
// *****************************************************************************
|
|
19
|
-
exports.MetricsContribution = Symbol('MetricsContribution');
|
|
20
|
-
//# sourceMappingURL=metrics-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metrics-contribution.js","sourceRoot":"","sources":["../../src/node/metrics-contribution.ts"],"names":[],"mappings":";;;AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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;AACnE,QAAA,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-metrics-contribution.d.ts","sourceRoot":"","sources":["../../src/node/node-metrics-contribution.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,qBACa,uBAAwB,YAAW,mBAAmB;IAC/D,UAAU,IAAI,MAAM;IAIpB,eAAe,IAAI,IAAI;CAM1B"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Ericsson 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.NodeMetricsContribution = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const prom = require("prom-client");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
let NodeMetricsContribution = class NodeMetricsContribution {
|
|
23
|
-
getMetrics() {
|
|
24
|
-
return prom.register.metrics().toString();
|
|
25
|
-
}
|
|
26
|
-
startCollecting() {
|
|
27
|
-
const collectDefaultMetrics = prom.collectDefaultMetrics;
|
|
28
|
-
// Probe every 5th second.
|
|
29
|
-
collectDefaultMetrics({ timeout: 5000 });
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.NodeMetricsContribution = NodeMetricsContribution;
|
|
33
|
-
exports.NodeMetricsContribution = NodeMetricsContribution = tslib_1.__decorate([
|
|
34
|
-
(0, inversify_1.injectable)()
|
|
35
|
-
], NodeMetricsContribution);
|
|
36
|
-
//# sourceMappingURL=node-metrics-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-metrics-contribution.js","sourceRoot":"","sources":["../../src/node/node-metrics-contribution.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,oCAAoC;AACpC,4DAA0D;AAInD,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAChC,UAAU;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC9C,CAAC;IAED,eAAe;QACX,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,CAAC;QAEzD,0BAA0B;QAC1B,qBAAqB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7C,CAAC;CACJ,CAAA;AAXY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,sBAAU,GAAE;GACA,uBAAuB,CAWnC"}
|
package/lib/node/prometheus.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.d.ts","sourceRoot":"","sources":["../../src/node/prometheus.ts"],"names":[],"mappings":"AAgBA,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED,eAAO,MAAM,iBAAiB,QAA8B,CAAC"}
|
package/lib/node/prometheus.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Ericsson 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.PROMETHEUS_REGEXP = exports.toPrometheusValidName = void 0;
|
|
19
|
-
function toPrometheusValidName(name) {
|
|
20
|
-
/* Make sure that start of name is valid and respect [a-zA-Z_:] */
|
|
21
|
-
const validFirstCharString = name.replace(/(^[^a-zA-Z_:]+)/gi, '');
|
|
22
|
-
/* Make sure that rest of the name respect [a-zA-Z0-9_:]* */
|
|
23
|
-
const validPrometheusName = validFirstCharString.replace(/([^a-zA-Z0-9_:])/gi, '_');
|
|
24
|
-
return validPrometheusName;
|
|
25
|
-
}
|
|
26
|
-
exports.toPrometheusValidName = toPrometheusValidName;
|
|
27
|
-
exports.PROMETHEUS_REGEXP = /^[a-zA-Z_:][a-zA-Z0-9_:]*/;
|
|
28
|
-
//# sourceMappingURL=prometheus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.js","sourceRoot":"","sources":["../../src/node/prometheus.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,SAAgB,qBAAqB,CAAC,IAAY;IAC9C,kEAAkE;IAClE,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACnE,4DAA4D;IAC5D,MAAM,mBAAmB,GAAG,oBAAoB,CAAC,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;IACpF,OAAO,mBAAmB,CAAC;AAC/B,CAAC;AAND,sDAMC;AAEY,QAAA,iBAAiB,GAAG,2BAA2B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.spec.d.ts","sourceRoot":"","sources":["../../src/node/prometheus.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2018 Ericsson 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 chai = require("chai");
|
|
19
|
-
const prometheus_1 = require("./prometheus");
|
|
20
|
-
const expect = chai.expect;
|
|
21
|
-
describe('Prometheus helper module', () => {
|
|
22
|
-
/* According to https://prometheus.io/docs/concepts/data_model/ */
|
|
23
|
-
const validName = 'theia_extension3242-:';
|
|
24
|
-
const invalidTheiaName = '@theia/something';
|
|
25
|
-
const validTheiaName = 'theia_something';
|
|
26
|
-
const invalidName2 = '@theia/?$%^ ';
|
|
27
|
-
it('Should correctly validate a metric name', () => {
|
|
28
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(validName)).to.be.true;
|
|
29
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(invalidTheiaName)).to.be.false;
|
|
30
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(invalidName2)).to.be.false;
|
|
31
|
-
});
|
|
32
|
-
it('Should correctly return a valid name from an otherwise invalid prometheus string', () => {
|
|
33
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(invalidTheiaName)).to.be.false;
|
|
34
|
-
const newName = (0, prometheus_1.toPrometheusValidName)(invalidTheiaName);
|
|
35
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(newName)).to.be.true;
|
|
36
|
-
expect(newName).to.be.equal(validTheiaName);
|
|
37
|
-
const newName2 = (0, prometheus_1.toPrometheusValidName)(invalidName2);
|
|
38
|
-
expect(prometheus_1.PROMETHEUS_REGEXP.test(newName2)).to.be.true;
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=prometheus.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prometheus.spec.js","sourceRoot":"","sources":["../../src/node/prometheus.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,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,6BAA6B;AAC7B,6CAAwE;AAExE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACtC,kEAAkE;IAElE,MAAM,SAAS,GAAG,uBAAuB,CAAC;IAC1C,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;IAC5C,MAAM,cAAc,GAAG,iBAAiB,CAAC;IACzC,MAAM,YAAY,GAAG,cAAc,CAAC;IAEpC,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QAC/C,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAErD,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QAE7D,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;IAE7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kFAAkF,EAAE,GAAG,EAAE;QACxF,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC;QAE7D,MAAM,OAAO,GAAG,IAAA,kCAAqB,EAAC,gBAAgB,CAAC,CAAC;QACxD,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACnD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,IAAA,kCAAqB,EAAC,YAAY,CAAC,CAAC;QACrD,MAAM,CAAC,8BAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|