@interopio/insights-metrics 0.0.187 → 0.0.189
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/dist/constants.d.ts +27 -27
- package/dist/constants.js +30 -30
- package/dist/factory/builder.d.ts +34 -34
- package/dist/factory/builder.js +296 -296
- package/dist/factory/factory.d.ts +10 -10
- package/dist/factory/factory.js +82 -82
- package/dist/factory/factory.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/manager.d.ts +26 -26
- package/dist/manager.js +167 -167
- package/dist/manager.js.map +1 -1
- package/dist/meter/lazyProvider.d.ts +15 -15
- package/dist/meter/lazyProvider.js +35 -35
- package/dist/meter/lazyProvider.js.map +1 -1
- package/dist/meter/providerFactory.d.ts +6 -6
- package/dist/meter/providerFactory.js +47 -47
- package/dist/meter/providerFactory.js.map +1 -1
- package/dist/metrics/application/count.d.ts +19 -19
- package/dist/metrics/application/count.js +68 -68
- package/dist/metrics/application/count.js.map +1 -1
- package/dist/metrics/application/cpu.d.ts +10 -10
- package/dist/metrics/application/cpu.js +47 -47
- package/dist/metrics/application/cpu.js.map +1 -1
- package/dist/metrics/application/crash.d.ts +16 -16
- package/dist/metrics/application/crash.js +48 -48
- package/dist/metrics/application/crash.js.map +1 -1
- package/dist/metrics/application/duration.d.ts +25 -25
- package/dist/metrics/application/duration.js +104 -104
- package/dist/metrics/application/duration.js.map +1 -1
- package/dist/metrics/application/durationSoft.d.ts +4 -4
- package/dist/metrics/application/durationSoft.js +33 -33
- package/dist/metrics/application/durationSoft.js.map +1 -1
- package/dist/metrics/application/error.d.ts +16 -16
- package/dist/metrics/application/error.js +48 -48
- package/dist/metrics/application/error.js.map +1 -1
- package/dist/metrics/application/memory.d.ts +11 -11
- package/dist/metrics/application/memory.js +49 -49
- package/dist/metrics/application/memory.js.map +1 -1
- package/dist/metrics/application/started.d.ts +16 -16
- package/dist/metrics/application/started.js +48 -48
- package/dist/metrics/application/started.js.map +1 -1
- package/dist/metrics/application/startup.d.ts +16 -16
- package/dist/metrics/application/startup.js +49 -49
- package/dist/metrics/application/startup.js.map +1 -1
- package/dist/metrics/application/stopped.d.ts +16 -16
- package/dist/metrics/application/stopped.js +48 -48
- package/dist/metrics/application/stopped.js.map +1 -1
- package/dist/metrics/base/base.d.ts +28 -28
- package/dist/metrics/base/base.js +181 -180
- package/dist/metrics/base/base.js.map +1 -1
- package/dist/metrics/base/observable.d.ts +19 -19
- package/dist/metrics/base/observable.js +88 -88
- package/dist/metrics/base/observable.js.map +1 -1
- package/dist/metrics/base/observableGauge.d.ts +6 -6
- package/dist/metrics/base/observableGauge.js +11 -11
- package/dist/metrics/base/zeroOutClosedAppObservableGaugeMetricBase.d.ts +12 -12
- package/dist/metrics/base/zeroOutClosedAppObservableGaugeMetricBase.js +38 -38
- package/dist/metrics/base/zeroOutClosedAppObservableGaugeMetricBase.js.map +1 -1
- package/dist/metrics/custom/customCounter.d.ts +10 -10
- package/dist/metrics/custom/customCounter.js +23 -23
- package/dist/metrics/custom/customCounter.js.map +1 -1
- package/dist/metrics/custom/customGauge.d.ts +10 -10
- package/dist/metrics/custom/customGauge.js +23 -23
- package/dist/metrics/custom/customGauge.js.map +1 -1
- package/dist/metrics/custom/customHistogram.d.ts +10 -10
- package/dist/metrics/custom/customHistogram.js +23 -23
- package/dist/metrics/custom/customHistogram.js.map +1 -1
- package/dist/metrics/custom/customObservableCounter.d.ts +6 -6
- package/dist/metrics/custom/customObservableCounter.js +12 -12
- package/dist/metrics/custom/customObservableGauge.d.ts +6 -6
- package/dist/metrics/custom/customObservableGauge.js +12 -12
- package/dist/metrics/custom/customObservableUpDownCounter.d.ts +6 -6
- package/dist/metrics/custom/customObservableUpDownCounter.js +12 -12
- package/dist/metrics/custom/customUpDownCounter.d.ts +10 -10
- package/dist/metrics/custom/customUpDownCounter.js +23 -23
- package/dist/metrics/custom/customUpDownCounter.js.map +1 -1
- package/dist/metrics/layout/startup.d.ts +15 -15
- package/dist/metrics/layout/startup.js +46 -46
- package/dist/metrics/layout/startup.js.map +1 -1
- package/dist/metrics/platform/error.d.ts +15 -15
- package/dist/metrics/platform/error.js +46 -46
- package/dist/metrics/platform/error.js.map +1 -1
- package/dist/metrics/platform/startup.d.ts +16 -16
- package/dist/metrics/platform/startup.js +46 -46
- package/dist/metrics/platform/startup.js.map +1 -1
- package/dist/metrics/system/cpu.d.ts +10 -10
- package/dist/metrics/system/cpu.js +49 -49
- package/dist/metrics/system/cpu.js.map +1 -1
- package/dist/metrics/system/memory.d.ts +10 -10
- package/dist/metrics/system/memory.js +50 -50
- package/dist/metrics/system/memory.js.map +1 -1
- package/dist/metrics/workspace/count.d.ts +23 -23
- package/dist/metrics/workspace/count.js +93 -93
- package/dist/metrics/workspace/count.js.map +1 -1
- package/dist/metrics/workspace/selected.d.ts +14 -14
- package/dist/metrics/workspace/selected.js +46 -46
- package/dist/metrics/workspace/selected.js.map +1 -1
- package/dist/metrics/workspace/started.d.ts +17 -17
- package/dist/metrics/workspace/started.js +48 -48
- package/dist/metrics/workspace/started.js.map +1 -1
- package/dist/metrics/workspace/startupLegacy.d.ts +8 -8
- package/dist/metrics/workspace/startupLegacy.js +19 -19
- package/dist/metrics/workspace/stopped.d.ts +15 -15
- package/dist/metrics/workspace/stopped.js +45 -45
- package/dist/metrics/workspace/stopped.js.map +1 -1
- package/dist/metrics/workspace/timedGauge.d.ts +14 -14
- package/dist/metrics/workspace/timedGauge.js +53 -53
- package/dist/metrics/workspace/timedGauge.js.map +1 -1
- package/dist/settings/builder.d.ts +26 -26
- package/dist/settings/builder.js +141 -141
- package/dist/settings/builder.js.map +1 -1
- package/dist/settings/default.d.ts +41 -41
- package/dist/settings/default.js +179 -179
- package/dist/settings/default.js.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.js +49 -50
- package/dist/utils.js.map +1 -1
- package/dist/validation/builder.d.ts +4 -4
- package/dist/validation/builder.js +11 -11
- package/dist/validation/container.d.ts +4 -4
- package/dist/validation/container.js +13 -13
- package/dist/validation/metrics/application/count.d.ts +7 -7
- package/dist/validation/metrics/application/count.js +20 -20
- package/dist/validation/metrics/application/duration.d.ts +6 -6
- package/dist/validation/metrics/application/duration.js +16 -16
- package/dist/validation/metrics/application/error.d.ts +6 -6
- package/dist/validation/metrics/application/error.js +15 -15
- package/dist/validation/metrics/application/started.d.ts +6 -6
- package/dist/validation/metrics/application/started.js +15 -15
- package/dist/validation/metrics/application/startupHistogram.d.ts +6 -6
- package/dist/validation/metrics/application/startupHistogram.js +17 -17
- package/dist/validation/metrics/application/stopped.d.ts +6 -6
- package/dist/validation/metrics/application/stopped.js +15 -15
- package/dist/validation/metrics/base/base.d.ts +5 -5
- package/dist/validation/metrics/base/base.js +21 -21
- package/dist/validation/metrics/base/gauge.d.ts +5 -5
- package/dist/validation/metrics/base/gauge.js +11 -11
- package/dist/validation/metrics/builder.d.ts +2 -2
- package/dist/validation/metrics/builder.js +6 -6
- package/dist/validation/metrics/factory.d.ts +4 -4
- package/dist/validation/metrics/factory.js +12 -12
- package/dist/validation/metrics/factoryBuilder.d.ts +5 -5
- package/dist/validation/metrics/factoryBuilder.js +22 -22
- package/dist/validation/metrics/layout/startupHistogram.d.ts +6 -6
- package/dist/validation/metrics/layout/startupHistogram.js +17 -17
- package/dist/validation/metrics/manager.d.ts +4 -4
- package/dist/validation/metrics/manager.js +14 -14
- package/dist/validation/metrics/meterFactory.d.ts +2 -2
- package/dist/validation/metrics/meterFactory.js +7 -7
- package/dist/validation/metrics/perf.d.ts +8 -8
- package/dist/validation/metrics/perf.js +40 -40
- package/dist/validation/metrics/platform/crash.d.ts +6 -6
- package/dist/validation/metrics/platform/crash.js +15 -15
- package/dist/validation/metrics/platform/error.d.ts +6 -6
- package/dist/validation/metrics/platform/error.js +14 -14
- package/dist/validation/metrics/platform/startup.d.ts +6 -6
- package/dist/validation/metrics/platform/startup.js +17 -17
- package/dist/validation/metrics/settingsBuilder.d.ts +4 -4
- package/dist/validation/metrics/settingsBuilder.js +25 -25
- package/dist/validation/metrics/workspace/count.d.ts +8 -8
- package/dist/validation/metrics/workspace/count.js +24 -24
- package/dist/validation/metrics/workspace/startedOrStoppedMetric.d.ts +8 -8
- package/dist/validation/metrics/workspace/startedOrStoppedMetric.js +18 -18
- package/dist/validation/validator.d.ts +4 -4
- package/dist/validation/validator.js +14 -14
- package/dist/validation/validator.js.map +1 -1
- package/package.json +15 -15
package/dist/settings/builder.js
CHANGED
|
@@ -1,142 +1,142 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MetricsSettingsBuilder = void 0;
|
|
4
|
-
const default_1 = require("./default");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const otel_1 = require("@interopio/otel");
|
|
7
|
-
class MetricsSettingsBuilder {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.metrics = new Map();
|
|
10
|
-
this.defaultSettings = new default_1.DefaultMetricsSettings();
|
|
11
|
-
this.withSettings({
|
|
12
|
-
enabled: false,
|
|
13
|
-
platformVersion: constants_1.Defaults.DEFAULT_PLATFORM_VERSION,
|
|
14
|
-
serviceId: constants_1.Defaults.DEFAULT_SERVICE_ID,
|
|
15
|
-
serviceName: constants_1.Defaults.DEFAULT_SERVICE_NAME,
|
|
16
|
-
userId: constants_1.Defaults.DEFAULT_USER,
|
|
17
|
-
serviceVersion: constants_1.Defaults.DEFAULT_SERVICE_VERSION,
|
|
18
|
-
metrics: this.defaultSettings
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
build() {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
23
|
-
if (!this.platformMetricsEnabled) {
|
|
24
|
-
for (const metricType of this.defaultSettings.metrics) {
|
|
25
|
-
this.metrics.delete((_a = metricType.name) !== null && _a !== void 0 ? _a : metricType.type);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
if ((_b = this.settings) === null || _b === void 0 ? void 0 : _b.useLegacyWorkspaceStartupMetric) {
|
|
30
|
-
this.metrics.set("workspace_startup", this.defaultSettings.getWorkspaceStartupLegacy());
|
|
31
|
-
const custom = (_d = (_c = this.settings) === null || _c === void 0 ? void 0 : _c.metrics) === null || _d === void 0 ? void 0 : _d.find(x => { var _a; return ((_a = x.name) !== null && _a !== void 0 ? _a : x.type) === "workspace_startup"; });
|
|
32
|
-
if (custom) {
|
|
33
|
-
this.withCustomMetric(custom);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
this.metrics.forEach((metric) => {
|
|
38
|
-
var _a;
|
|
39
|
-
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, this.convert(metric));
|
|
40
|
-
});
|
|
41
|
-
const headers = (_f = (_e = this.meter) === null || _e === void 0 ? void 0 : _e.headers) !== null && _f !== void 0 ? _f : Object.assign(Object.assign({}, otel_1.Container.errorless((_g = this.otelSettings) === null || _g === void 0 ? void 0 : _g.headers)), otel_1.Container.errorless((_h = this.settings) === null || _h === void 0 ? void 0 : _h.headers));
|
|
42
|
-
const additionalAttributes = () => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
return (Object.assign(Object.assign({}, otel_1.Container.errorless((_a = this.otelSettings) === null || _a === void 0 ? void 0 : _a.additionalAttributes)), otel_1.Container.errorless((_b = this.settings) === null || _b === void 0 ? void 0 : _b.additionalAttributes)));
|
|
45
|
-
};
|
|
46
|
-
const settings = Object.assign(Object.assign({}, this.settings), { enabled: this.enabled, platformMetricsEnabled: this.platformMetricsEnabled, url: (_l = (_j = this.meter.url) !== null && _j !== void 0 ? _j : (_k = this.settings) === null || _k === void 0 ? void 0 : _k.url) !== null && _l !== void 0 ? _l : "http://localhost:4318/v1/metrics", publishInterval: (_p = (_m = this.meter.publishInterval) !== null && _m !== void 0 ? _m : (_o = this.settings) === null || _o === void 0 ? void 0 : _o.publishInterval) !== null && _p !== void 0 ? _p : 30000, compression: (_q = this.meter.compression) !== null && _q !== void 0 ? _q : (_r = this.settings) === null || _r === void 0 ? void 0 : _r.compression, headers, hostname: (_s = this.meter.hostname) !== null && _s !== void 0 ? _s : (_t = this.settings) === null || _t === void 0 ? void 0 : _t.hostname, keepAlive: (_u = this.meter.keepAlive) !== null && _u !== void 0 ? _u : (_v = this.settings) === null || _v === void 0 ? void 0 : _v.keepAlive, concurrencyLimit: (_w = this.meter.concurrencyLimit) !== null && _w !== void 0 ? _w : (_x = this.settings) === null || _x === void 0 ? void 0 : _x.concurrencyLimit,
|
|
47
|
-
/** Maximum time the OTLP exporter will wait for each batch export.
|
|
48
|
-
* The default value is 10000ms. */
|
|
49
|
-
timeoutMillis: (_y = this.meter.timeoutMillis) !== null && _y !== void 0 ? _y : (_z = this.settings) === null || _z === void 0 ? void 0 : _z.timeoutMillis, metrics: [...this.metrics.values()], additionalAttributes });
|
|
50
|
-
return settings;
|
|
51
|
-
}
|
|
52
|
-
withSettings(otelSettings) {
|
|
53
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
54
|
-
const oldOtelSettings = this.otelSettings;
|
|
55
|
-
this.otelSettings = otelSettings;
|
|
56
|
-
const oldSettings = this.settings;
|
|
57
|
-
this.settings = otelSettings === null || otelSettings === void 0 ? void 0 : otelSettings.metrics;
|
|
58
|
-
return this.withEnabled((_b = (_a = this.settings) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : oldSettings === null || oldSettings === void 0 ? void 0 : oldSettings.enabled)
|
|
59
|
-
.withPlatformMetricsEnabled((_d = (_c = this.settings) === null || _c === void 0 ? void 0 : _c.platformMetricsEnabled) !== null && _d !== void 0 ? _d : oldSettings === null || oldSettings === void 0 ? void 0 : oldSettings.platformMetricsEnabled)
|
|
60
|
-
.withUser((_f = (_e = this.otelSettings) === null || _e === void 0 ? void 0 : _e.userId) !== null && _f !== void 0 ? _f : oldOtelSettings === null || oldOtelSettings === void 0 ? void 0 : oldOtelSettings.userId)
|
|
61
|
-
.withPlatformVersion((_h = (_g = this.otelSettings) === null || _g === void 0 ? void 0 : _g.platformVersion) !== null && _h !== void 0 ? _h : oldOtelSettings === null || oldOtelSettings === void 0 ? void 0 : oldOtelSettings.platformVersion)
|
|
62
|
-
.withAdditionalAttributes((_j = this.settings) === null || _j === void 0 ? void 0 : _j.additionalAttributes)
|
|
63
|
-
.withCustomMetrics((_k = this.settings) === null || _k === void 0 ? void 0 : _k.metrics)
|
|
64
|
-
.withMeter((_m = (_l = this.settings) === null || _l === void 0 ? void 0 : _l.meter) !== null && _m !== void 0 ? _m : this.meter);
|
|
65
|
-
}
|
|
66
|
-
withEnabled(enabled) {
|
|
67
|
-
this.enabled = enabled !== null && enabled !== void 0 ? enabled : this.enabled;
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
withUser(userId) {
|
|
71
|
-
this.userId = userId !== null && userId !== void 0 ? userId : this.userId;
|
|
72
|
-
this.metrics.forEach((metric) => {
|
|
73
|
-
var _a;
|
|
74
|
-
metric.user = this.userId;
|
|
75
|
-
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
76
|
-
});
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
withAdditionalAttributes(additionalAttributes) {
|
|
80
|
-
this.additionalAttributes = additionalAttributes !== null && additionalAttributes !== void 0 ? additionalAttributes : this.additionalAttributes;
|
|
81
|
-
this.metrics.forEach((metric) => {
|
|
82
|
-
var _a;
|
|
83
|
-
metric.additionalAttributes = this.additionalAttributes;
|
|
84
|
-
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
85
|
-
});
|
|
86
|
-
return this;
|
|
87
|
-
}
|
|
88
|
-
withPlatformVersion(version) {
|
|
89
|
-
this.platformVersion = version !== null && version !== void 0 ? version : this.platformVersion;
|
|
90
|
-
this.metrics.forEach((metric) => {
|
|
91
|
-
var _a;
|
|
92
|
-
metric.platformVersion = this.platformVersion;
|
|
93
|
-
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
94
|
-
});
|
|
95
|
-
return this;
|
|
96
|
-
}
|
|
97
|
-
withPlatformMetricsEnabled(enabled) {
|
|
98
|
-
this.platformMetricsEnabled = enabled !== null && enabled !== void 0 ? enabled : this.platformMetricsEnabled;
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
-
withMeter(settings) {
|
|
103
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
104
|
-
const defaultMeterSettings = this.meter;
|
|
105
|
-
this.meter = Object.assign(Object.assign(Object.assign({}, defaultMeterSettings), (settings !== null && settings !== void 0 ? settings : {})), { url: (_a = settings === null || settings === void 0 ? void 0 : settings.url) !== null && _a !== void 0 ? _a : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.url, publishInterval: (_b = settings === null || settings === void 0 ? void 0 : settings.publishInterval) !== null && _b !== void 0 ? _b : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.publishInterval, compression: (_e = (_c = settings === null || settings === void 0 ? void 0 : settings.compression) !== null && _c !== void 0 ? _c : (_d = this.settings) === null || _d === void 0 ? void 0 : _d.compression) !== null && _e !== void 0 ? _e : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.compression, headers: (_f = settings === null || settings === void 0 ? void 0 : settings.headers) !== null && _f !== void 0 ? _f : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.headers, hostname: (_g = settings === null || settings === void 0 ? void 0 : settings.hostname) !== null && _g !== void 0 ? _g : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.hostname, keepAlive: (_h = settings === null || settings === void 0 ? void 0 : settings.keepAlive) !== null && _h !== void 0 ? _h : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.keepAlive, concurrencyLimit: (_j = settings === null || settings === void 0 ? void 0 : settings.concurrencyLimit) !== null && _j !== void 0 ? _j : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.concurrencyLimit, timeoutMillis: (_k = settings === null || settings === void 0 ? void 0 : settings.timeoutMillis) !== null && _k !== void 0 ? _k : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.timeoutMillis });
|
|
106
|
-
return this;
|
|
107
|
-
}
|
|
108
|
-
withCustomMetrics(settings) {
|
|
109
|
-
const customMetrics = settings !== null && settings !== void 0 ? settings : [];
|
|
110
|
-
customMetrics.forEach((metricSettings) => this.withCustomMetric(metricSettings));
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
withCustomMetric(custom) {
|
|
114
|
-
var _a, _b, _c, _d;
|
|
115
|
-
if (!custom.name) {
|
|
116
|
-
throw new Error("settings.name is not defined");
|
|
117
|
-
}
|
|
118
|
-
const hasSettings = this.metrics.has((_a = custom.name) !== null && _a !== void 0 ? _a : custom.type);
|
|
119
|
-
if (!hasSettings) {
|
|
120
|
-
const converted = this.convert(custom);
|
|
121
|
-
this.metrics.set((_b = custom.name) !== null && _b !== void 0 ? _b : custom.type, converted);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
const existing = this.metrics.get((_c = custom.name) !== null && _c !== void 0 ? _c : custom.type);
|
|
125
|
-
const merged = this.mergeSettings(custom, existing);
|
|
126
|
-
this.metrics.set((_d = merged.name) !== null && _d !== void 0 ? _d : merged.type, merged);
|
|
127
|
-
}
|
|
128
|
-
return this;
|
|
129
|
-
}
|
|
130
|
-
convert(custom) {
|
|
131
|
-
var _a, _b, _c, _d;
|
|
132
|
-
const converted = Object.assign(Object.assign(Object.assign({}, this.settings), custom), { type: custom.type, user: this.userId, enabled: (_a = custom.enabled) !== null && _a !== void 0 ? _a : true, name: (_b = custom.name) !== null && _b !== void 0 ? _b : custom.type, description: (_c = custom.description) !== null && _c !== void 0 ? _c : ((_d = custom.name) !== null && _d !== void 0 ? _d : custom.type), platformVersion: this.platformVersion, unit: custom.unit, buckets: custom.buckets, additionalAttributes: custom.additionalAttributes });
|
|
133
|
-
return converted;
|
|
134
|
-
}
|
|
135
|
-
mergeSettings(custom, existing) {
|
|
136
|
-
var _a, _b, _c, _d, _e;
|
|
137
|
-
const converted = Object.assign(Object.assign(Object.assign({}, existing), this.settings), { type: custom.type, user: this.userId, enabled: (_a = custom.enabled) !== null && _a !== void 0 ? _a : existing.enabled, name: (_b = custom.name) !== null && _b !== void 0 ? _b : existing.name, description: (_c = custom.description) !== null && _c !== void 0 ? _c : existing.description, platformVersion: this.platformVersion, unit: existing.unit, buckets: (_d = custom.buckets) !== null && _d !== void 0 ? _d : existing.buckets, additionalAttributes: (_e = custom.additionalAttributes) !== null && _e !== void 0 ? _e : existing.additionalAttributes });
|
|
138
|
-
return converted;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.MetricsSettingsBuilder = MetricsSettingsBuilder;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetricsSettingsBuilder = void 0;
|
|
4
|
+
const default_1 = require("./default");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const otel_1 = require("@interopio/otel");
|
|
7
|
+
class MetricsSettingsBuilder {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.metrics = new Map();
|
|
10
|
+
this.defaultSettings = new default_1.DefaultMetricsSettings();
|
|
11
|
+
this.withSettings({
|
|
12
|
+
enabled: false,
|
|
13
|
+
platformVersion: constants_1.Defaults.DEFAULT_PLATFORM_VERSION,
|
|
14
|
+
serviceId: constants_1.Defaults.DEFAULT_SERVICE_ID,
|
|
15
|
+
serviceName: constants_1.Defaults.DEFAULT_SERVICE_NAME,
|
|
16
|
+
userId: constants_1.Defaults.DEFAULT_USER,
|
|
17
|
+
serviceVersion: constants_1.Defaults.DEFAULT_SERVICE_VERSION,
|
|
18
|
+
metrics: this.defaultSettings
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
build() {
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
23
|
+
if (!this.platformMetricsEnabled) {
|
|
24
|
+
for (const metricType of this.defaultSettings.metrics) {
|
|
25
|
+
this.metrics.delete((_a = metricType.name) !== null && _a !== void 0 ? _a : metricType.type);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
if ((_b = this.settings) === null || _b === void 0 ? void 0 : _b.useLegacyWorkspaceStartupMetric) {
|
|
30
|
+
this.metrics.set("workspace_startup", this.defaultSettings.getWorkspaceStartupLegacy());
|
|
31
|
+
const custom = (_d = (_c = this.settings) === null || _c === void 0 ? void 0 : _c.metrics) === null || _d === void 0 ? void 0 : _d.find(x => { var _a; return ((_a = x.name) !== null && _a !== void 0 ? _a : x.type) === "workspace_startup"; });
|
|
32
|
+
if (custom) {
|
|
33
|
+
this.withCustomMetric(custom);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
this.metrics.forEach((metric) => {
|
|
38
|
+
var _a;
|
|
39
|
+
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, this.convert(metric));
|
|
40
|
+
});
|
|
41
|
+
const headers = (_f = (_e = this.meter) === null || _e === void 0 ? void 0 : _e.headers) !== null && _f !== void 0 ? _f : Object.assign(Object.assign({}, otel_1.Container.errorless((_g = this.otelSettings) === null || _g === void 0 ? void 0 : _g.headers)), otel_1.Container.errorless((_h = this.settings) === null || _h === void 0 ? void 0 : _h.headers));
|
|
42
|
+
const additionalAttributes = () => {
|
|
43
|
+
var _a, _b;
|
|
44
|
+
return (Object.assign(Object.assign({}, otel_1.Container.errorless((_a = this.otelSettings) === null || _a === void 0 ? void 0 : _a.additionalAttributes)), otel_1.Container.errorless((_b = this.settings) === null || _b === void 0 ? void 0 : _b.additionalAttributes)));
|
|
45
|
+
};
|
|
46
|
+
const settings = Object.assign(Object.assign({}, this.settings), { enabled: this.enabled, platformMetricsEnabled: this.platformMetricsEnabled, url: (_l = (_j = this.meter.url) !== null && _j !== void 0 ? _j : (_k = this.settings) === null || _k === void 0 ? void 0 : _k.url) !== null && _l !== void 0 ? _l : "http://localhost:4318/v1/metrics", publishInterval: (_p = (_m = this.meter.publishInterval) !== null && _m !== void 0 ? _m : (_o = this.settings) === null || _o === void 0 ? void 0 : _o.publishInterval) !== null && _p !== void 0 ? _p : 30000, compression: (_q = this.meter.compression) !== null && _q !== void 0 ? _q : (_r = this.settings) === null || _r === void 0 ? void 0 : _r.compression, headers, hostname: (_s = this.meter.hostname) !== null && _s !== void 0 ? _s : (_t = this.settings) === null || _t === void 0 ? void 0 : _t.hostname, keepAlive: (_u = this.meter.keepAlive) !== null && _u !== void 0 ? _u : (_v = this.settings) === null || _v === void 0 ? void 0 : _v.keepAlive, concurrencyLimit: (_w = this.meter.concurrencyLimit) !== null && _w !== void 0 ? _w : (_x = this.settings) === null || _x === void 0 ? void 0 : _x.concurrencyLimit,
|
|
47
|
+
/** Maximum time the OTLP exporter will wait for each batch export.
|
|
48
|
+
* The default value is 10000ms. */
|
|
49
|
+
timeoutMillis: (_y = this.meter.timeoutMillis) !== null && _y !== void 0 ? _y : (_z = this.settings) === null || _z === void 0 ? void 0 : _z.timeoutMillis, metrics: [...this.metrics.values()], additionalAttributes });
|
|
50
|
+
return settings;
|
|
51
|
+
}
|
|
52
|
+
withSettings(otelSettings) {
|
|
53
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
54
|
+
const oldOtelSettings = this.otelSettings;
|
|
55
|
+
this.otelSettings = otelSettings;
|
|
56
|
+
const oldSettings = this.settings;
|
|
57
|
+
this.settings = otelSettings === null || otelSettings === void 0 ? void 0 : otelSettings.metrics;
|
|
58
|
+
return this.withEnabled((_b = (_a = this.settings) === null || _a === void 0 ? void 0 : _a.enabled) !== null && _b !== void 0 ? _b : oldSettings === null || oldSettings === void 0 ? void 0 : oldSettings.enabled)
|
|
59
|
+
.withPlatformMetricsEnabled((_d = (_c = this.settings) === null || _c === void 0 ? void 0 : _c.platformMetricsEnabled) !== null && _d !== void 0 ? _d : oldSettings === null || oldSettings === void 0 ? void 0 : oldSettings.platformMetricsEnabled)
|
|
60
|
+
.withUser((_f = (_e = this.otelSettings) === null || _e === void 0 ? void 0 : _e.userId) !== null && _f !== void 0 ? _f : oldOtelSettings === null || oldOtelSettings === void 0 ? void 0 : oldOtelSettings.userId)
|
|
61
|
+
.withPlatformVersion((_h = (_g = this.otelSettings) === null || _g === void 0 ? void 0 : _g.platformVersion) !== null && _h !== void 0 ? _h : oldOtelSettings === null || oldOtelSettings === void 0 ? void 0 : oldOtelSettings.platformVersion)
|
|
62
|
+
.withAdditionalAttributes((_j = this.settings) === null || _j === void 0 ? void 0 : _j.additionalAttributes)
|
|
63
|
+
.withCustomMetrics((_k = this.settings) === null || _k === void 0 ? void 0 : _k.metrics)
|
|
64
|
+
.withMeter((_m = (_l = this.settings) === null || _l === void 0 ? void 0 : _l.meter) !== null && _m !== void 0 ? _m : this.meter);
|
|
65
|
+
}
|
|
66
|
+
withEnabled(enabled) {
|
|
67
|
+
this.enabled = enabled !== null && enabled !== void 0 ? enabled : this.enabled;
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
withUser(userId) {
|
|
71
|
+
this.userId = userId !== null && userId !== void 0 ? userId : this.userId;
|
|
72
|
+
this.metrics.forEach((metric) => {
|
|
73
|
+
var _a;
|
|
74
|
+
metric.user = this.userId;
|
|
75
|
+
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
76
|
+
});
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
withAdditionalAttributes(additionalAttributes) {
|
|
80
|
+
this.additionalAttributes = additionalAttributes !== null && additionalAttributes !== void 0 ? additionalAttributes : this.additionalAttributes;
|
|
81
|
+
this.metrics.forEach((metric) => {
|
|
82
|
+
var _a;
|
|
83
|
+
metric.additionalAttributes = this.additionalAttributes;
|
|
84
|
+
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
85
|
+
});
|
|
86
|
+
return this;
|
|
87
|
+
}
|
|
88
|
+
withPlatformVersion(version) {
|
|
89
|
+
this.platformVersion = version !== null && version !== void 0 ? version : this.platformVersion;
|
|
90
|
+
this.metrics.forEach((metric) => {
|
|
91
|
+
var _a;
|
|
92
|
+
metric.platformVersion = this.platformVersion;
|
|
93
|
+
this.metrics.set((_a = metric.name) !== null && _a !== void 0 ? _a : metric.type, metric);
|
|
94
|
+
});
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
withPlatformMetricsEnabled(enabled) {
|
|
98
|
+
this.platformMetricsEnabled = enabled !== null && enabled !== void 0 ? enabled : this.platformMetricsEnabled;
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
withMeter(settings) {
|
|
103
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
104
|
+
const defaultMeterSettings = this.meter;
|
|
105
|
+
this.meter = Object.assign(Object.assign(Object.assign({}, defaultMeterSettings), (settings !== null && settings !== void 0 ? settings : {})), { url: (_a = settings === null || settings === void 0 ? void 0 : settings.url) !== null && _a !== void 0 ? _a : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.url, publishInterval: (_b = settings === null || settings === void 0 ? void 0 : settings.publishInterval) !== null && _b !== void 0 ? _b : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.publishInterval, compression: (_e = (_c = settings === null || settings === void 0 ? void 0 : settings.compression) !== null && _c !== void 0 ? _c : (_d = this.settings) === null || _d === void 0 ? void 0 : _d.compression) !== null && _e !== void 0 ? _e : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.compression, headers: (_f = settings === null || settings === void 0 ? void 0 : settings.headers) !== null && _f !== void 0 ? _f : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.headers, hostname: (_g = settings === null || settings === void 0 ? void 0 : settings.hostname) !== null && _g !== void 0 ? _g : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.hostname, keepAlive: (_h = settings === null || settings === void 0 ? void 0 : settings.keepAlive) !== null && _h !== void 0 ? _h : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.keepAlive, concurrencyLimit: (_j = settings === null || settings === void 0 ? void 0 : settings.concurrencyLimit) !== null && _j !== void 0 ? _j : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.concurrencyLimit, timeoutMillis: (_k = settings === null || settings === void 0 ? void 0 : settings.timeoutMillis) !== null && _k !== void 0 ? _k : defaultMeterSettings === null || defaultMeterSettings === void 0 ? void 0 : defaultMeterSettings.timeoutMillis });
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
withCustomMetrics(settings) {
|
|
109
|
+
const customMetrics = settings !== null && settings !== void 0 ? settings : [];
|
|
110
|
+
customMetrics.forEach((metricSettings) => this.withCustomMetric(metricSettings));
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
withCustomMetric(custom) {
|
|
114
|
+
var _a, _b, _c, _d;
|
|
115
|
+
if (!custom.name) {
|
|
116
|
+
throw new Error("settings.name is not defined");
|
|
117
|
+
}
|
|
118
|
+
const hasSettings = this.metrics.has((_a = custom.name) !== null && _a !== void 0 ? _a : custom.type);
|
|
119
|
+
if (!hasSettings) {
|
|
120
|
+
const converted = this.convert(custom);
|
|
121
|
+
this.metrics.set((_b = custom.name) !== null && _b !== void 0 ? _b : custom.type, converted);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
const existing = this.metrics.get((_c = custom.name) !== null && _c !== void 0 ? _c : custom.type);
|
|
125
|
+
const merged = this.mergeSettings(custom, existing);
|
|
126
|
+
this.metrics.set((_d = merged.name) !== null && _d !== void 0 ? _d : merged.type, merged);
|
|
127
|
+
}
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
convert(custom) {
|
|
131
|
+
var _a, _b, _c, _d;
|
|
132
|
+
const converted = Object.assign(Object.assign(Object.assign({}, this.settings), custom), { type: custom.type, user: this.userId, enabled: (_a = custom.enabled) !== null && _a !== void 0 ? _a : true, name: (_b = custom.name) !== null && _b !== void 0 ? _b : custom.type, description: (_c = custom.description) !== null && _c !== void 0 ? _c : ((_d = custom.name) !== null && _d !== void 0 ? _d : custom.type), platformVersion: this.platformVersion, unit: custom.unit, buckets: custom.buckets, additionalAttributes: custom.additionalAttributes });
|
|
133
|
+
return converted;
|
|
134
|
+
}
|
|
135
|
+
mergeSettings(custom, existing) {
|
|
136
|
+
var _a, _b, _c, _d, _e;
|
|
137
|
+
const converted = Object.assign(Object.assign(Object.assign({}, existing), this.settings), { type: custom.type, user: this.userId, enabled: (_a = custom.enabled) !== null && _a !== void 0 ? _a : existing.enabled, name: (_b = custom.name) !== null && _b !== void 0 ? _b : existing.name, description: (_c = custom.description) !== null && _c !== void 0 ? _c : existing.description, platformVersion: this.platformVersion, unit: existing.unit, buckets: (_d = custom.buckets) !== null && _d !== void 0 ? _d : existing.buckets, additionalAttributes: (_e = custom.additionalAttributes) !== null && _e !== void 0 ? _e : existing.additionalAttributes });
|
|
138
|
+
return converted;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.MetricsSettingsBuilder = MetricsSettingsBuilder;
|
|
142
142
|
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/settings/builder.ts"],"names":[],"mappings":";;;AAAA,uCAAmD;AACnD,4CAAwC;AAExC,0CAA4C;AAE5C,MAAa,sBAAsB;IAc/B;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAqC,CAAC;QAC5D,IAAI,CAAC,eAAe,GAAG,IAAI,gCAAsB,EAAE,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC;YACd,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,oBAAQ,CAAC,wBAAwB;YAClD,SAAS,EAAE,oBAAQ,CAAC,kBAAkB;YACtC,WAAW,EAAE,oBAAQ,CAAC,oBAAoB;YAC1C,MAAM,EAAE,oBAAQ,CAAC,YAAY;YAC7B,cAAc,EAAE,oBAAQ,CAAC,uBAAuB;YAChD,OAAO,EAAE,IAAI,CAAC,eAAe;SAChC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK;;QACR,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/settings/builder.ts"],"names":[],"mappings":";;;AAAA,uCAAmD;AACnD,4CAAwC;AAExC,0CAA4C;AAE5C,MAAa,sBAAsB;IAc/B;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAqC,CAAC;QAC5D,IAAI,CAAC,eAAe,GAAG,IAAI,gCAAsB,EAAE,CAAC;QACpD,IAAI,CAAC,YAAY,CAAC;YACd,OAAO,EAAE,KAAK;YACd,eAAe,EAAE,oBAAQ,CAAC,wBAAwB;YAClD,SAAS,EAAE,oBAAQ,CAAC,kBAAkB;YACtC,WAAW,EAAE,oBAAQ,CAAC,oBAAoB;YAC1C,MAAM,EAAE,oBAAQ,CAAC,YAAY;YAC7B,cAAc,EAAE,oBAAQ,CAAC,uBAAuB;YAChD,OAAO,EAAE,IAAI,CAAC,eAAe;SAChC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK;;QACR,IAAI,CAAC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AAO,EAC3C,oBAAoB,EAAE,MAAA,MAAM,CAAC,oBAAoB,mCAAI,QAAQ,CAAC,oBAAoB,GACrF,CAAC;QACF,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAjND,wDAiNC"}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { IOInsights } from "@interopio/otel/insights";
|
|
2
|
-
export declare class DefaultMetricsSettings implements IOInsights.MetricsSettings {
|
|
3
|
-
static instance: DefaultMetricsSettings;
|
|
4
|
-
private unknown;
|
|
5
|
-
get enabled(): boolean;
|
|
6
|
-
get platformMetricsEnabled(): boolean;
|
|
7
|
-
get userId(): string;
|
|
8
|
-
get platformVersion(): string;
|
|
9
|
-
get additionalAttributes(): {
|
|
10
|
-
[key: string]: string;
|
|
11
|
-
};
|
|
12
|
-
get metrics(): IOInsights.MetricSettings[];
|
|
13
|
-
getWorkspaceStartupLegacy(): IOInsights.MetricSettings;
|
|
14
|
-
private getWorkspaceStartup;
|
|
15
|
-
private getWorkspaceStartupFrame;
|
|
16
|
-
private getWorkspaceStartupFrameInit;
|
|
17
|
-
private getWorkspaceStartupFramePageLoad;
|
|
18
|
-
private getWorkspaceStartupFrameWorkspaceRender;
|
|
19
|
-
private getWorkspaceStartupComponent;
|
|
20
|
-
private getWorkspaceStartupApps;
|
|
21
|
-
private getAppStarted;
|
|
22
|
-
private getAppStopped;
|
|
23
|
-
private getAppCount;
|
|
24
|
-
private getAppStartup;
|
|
25
|
-
private getAppDuration;
|
|
26
|
-
private getAppDurationSoft;
|
|
27
|
-
private getAppMemory;
|
|
28
|
-
private getAppCPU;
|
|
29
|
-
private getAppError;
|
|
30
|
-
private getAppCrash;
|
|
31
|
-
private getLayoutStartup;
|
|
32
|
-
private getWorkspaceStarted;
|
|
33
|
-
private getWorkspaceStopped;
|
|
34
|
-
private getWorkspaceSelected;
|
|
35
|
-
private getWorkspaceCount;
|
|
36
|
-
private getPlatformStartup;
|
|
37
|
-
private getPlatformError;
|
|
38
|
-
private getSystemMemory;
|
|
39
|
-
private getSystemCPU;
|
|
40
|
-
private getSettings;
|
|
41
|
-
}
|
|
1
|
+
import { IOInsights } from "@interopio/otel/insights";
|
|
2
|
+
export declare class DefaultMetricsSettings implements IOInsights.MetricsSettings {
|
|
3
|
+
static instance: DefaultMetricsSettings;
|
|
4
|
+
private unknown;
|
|
5
|
+
get enabled(): boolean;
|
|
6
|
+
get platformMetricsEnabled(): boolean;
|
|
7
|
+
get userId(): string;
|
|
8
|
+
get platformVersion(): string;
|
|
9
|
+
get additionalAttributes(): {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
get metrics(): IOInsights.MetricSettings[];
|
|
13
|
+
getWorkspaceStartupLegacy(): IOInsights.MetricSettings;
|
|
14
|
+
private getWorkspaceStartup;
|
|
15
|
+
private getWorkspaceStartupFrame;
|
|
16
|
+
private getWorkspaceStartupFrameInit;
|
|
17
|
+
private getWorkspaceStartupFramePageLoad;
|
|
18
|
+
private getWorkspaceStartupFrameWorkspaceRender;
|
|
19
|
+
private getWorkspaceStartupComponent;
|
|
20
|
+
private getWorkspaceStartupApps;
|
|
21
|
+
private getAppStarted;
|
|
22
|
+
private getAppStopped;
|
|
23
|
+
private getAppCount;
|
|
24
|
+
private getAppStartup;
|
|
25
|
+
private getAppDuration;
|
|
26
|
+
private getAppDurationSoft;
|
|
27
|
+
private getAppMemory;
|
|
28
|
+
private getAppCPU;
|
|
29
|
+
private getAppError;
|
|
30
|
+
private getAppCrash;
|
|
31
|
+
private getLayoutStartup;
|
|
32
|
+
private getWorkspaceStarted;
|
|
33
|
+
private getWorkspaceStopped;
|
|
34
|
+
private getWorkspaceSelected;
|
|
35
|
+
private getWorkspaceCount;
|
|
36
|
+
private getPlatformStartup;
|
|
37
|
+
private getPlatformError;
|
|
38
|
+
private getSystemMemory;
|
|
39
|
+
private getSystemCPU;
|
|
40
|
+
private getSettings;
|
|
41
|
+
}
|