@observertc/client-monitor-js 1.3.2 → 2.0.1-8dfd576.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Accumulator.d.ts +3 -3
- package/lib/Accumulator.d.ts.map +1 -1
- package/lib/Accumulator.js +4 -4
- package/lib/ClientDevices.d.ts +2 -2
- package/lib/ClientDevices.d.ts.map +1 -1
- package/lib/ClientDevices.js +11 -11
- package/lib/ClientMonitor.d.ts +117 -105
- package/lib/ClientMonitor.d.ts.map +1 -1
- package/lib/ClientMonitorImpl.d.ts +16 -20
- package/lib/ClientMonitorImpl.d.ts.map +1 -1
- package/lib/ClientMonitorImpl.js +95 -152
- package/lib/Collectors.d.ts +1 -1
- package/lib/Collectors.d.ts.map +1 -1
- package/lib/Collectors.js +5 -4
- package/lib/Sampler.d.ts +4 -60
- package/lib/Sampler.d.ts.map +1 -1
- package/lib/Sampler.js +27 -172
- package/lib/adapters/Adapter.d.ts +1 -1
- package/lib/adapters/Adapter.d.ts.map +1 -1
- package/lib/adapters/Adapter.js +41 -41
- package/lib/collectors/MediasoupStatsCollector.d.ts +2 -2
- package/lib/collectors/MediasoupStatsCollector.d.ts.map +1 -1
- package/lib/collectors/MediasoupStatsCollector.js +69 -42
- package/lib/collectors/MediasoupSurrogates.d.ts +7 -7
- package/lib/collectors/MediasoupSurrogates.d.ts.map +1 -1
- package/lib/collectors/PeerConnectionStatsCollector.d.ts.map +1 -1
- package/lib/collectors/PeerConnectionStatsCollector.js +1 -6
- package/lib/collectors/StatsCollector.d.ts +1 -1
- package/lib/collectors/StatsCollector.d.ts.map +1 -1
- package/lib/entries/PeerConnectionEntryImpl.d.ts +8 -13
- package/lib/entries/PeerConnectionEntryImpl.d.ts.map +1 -1
- package/lib/entries/PeerConnectionEntryImpl.js +715 -890
- package/lib/entries/StatsEntryInterfaces.d.ts +6 -13
- package/lib/entries/StatsEntryInterfaces.d.ts.map +1 -1
- package/lib/entries/StatsStorage.d.ts +6 -8
- package/lib/entries/StatsStorage.d.ts.map +1 -1
- package/lib/entries/StatsStorage.js +20 -24
- package/lib/index.d.ts +3 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -11
- package/lib/utils/MediaDevices.d.ts +2 -2
- package/lib/utils/MediaDevices.d.ts.map +1 -1
- package/lib/utils/StatsVisitor.d.ts +4 -9
- package/lib/utils/StatsVisitor.d.ts.map +1 -1
- package/lib/utils/StatsVisitor.js +21 -37
- package/lib/utils/Timer.d.ts +2 -2
- package/lib/utils/Timer.d.ts.map +1 -1
- package/lib/utils/callEvents.d.ts +12 -0
- package/lib/utils/callEvents.d.ts.map +1 -0
- package/lib/utils/callEvents.js +15 -0
- package/lib/utils/common.d.ts +1 -0
- package/lib/utils/common.d.ts.map +1 -1
- package/lib/utils/common.js +2 -2
- package/lib/utils/logger.d.ts +18 -5
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +140 -49
- package/lib/utils/{hash.d.ts → makeStamp.d.ts} +1 -1
- package/lib/utils/makeStamp.d.ts.map +1 -0
- package/lib/utils/{hash.js → makeStamp.js} +1 -0
- package/lib/utils/reverseEnums.d.ts +1 -1
- package/lib/utils/reverseEnums.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/Accumulator.ts +1 -1
- package/src/ClientDevices.ts +9 -9
- package/src/ClientMonitor.ts +125 -109
- package/src/ClientMonitorImpl.ts +111 -166
- package/src/Collectors.ts +1 -0
- package/src/Sampler.ts +27 -229
- package/src/adapters/Adapter.ts +1 -1
- package/src/collectors/MediasoupStatsCollector.ts +82 -37
- package/src/collectors/MediasoupSurrogates.ts +3 -1
- package/src/collectors/PeerConnectionStatsCollector.ts +4 -6
- package/src/collectors/StatsCollector.ts +1 -0
- package/src/entries/PeerConnectionEntryImpl.ts +132 -278
- package/src/entries/StatsEntryInterfaces.ts +14 -13
- package/src/entries/StatsStorage.ts +28 -31
- package/src/index.ts +3 -12
- package/src/utils/MediaDevices.ts +1 -1
- package/src/utils/StatsVisitor.ts +6 -22
- package/src/utils/callEvents.ts +12 -0
- package/src/utils/common.ts +1 -1
- package/src/utils/logger.ts +171 -30
- package/src/utils/{hash.ts → makeStamp.ts} +2 -1
- package/.github/workflows/publish.yaml +0 -42
- package/CHANGELOG.md +0 -37
- package/CONTRIBUTING.md +0 -29
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -92
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +0 -52
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1413
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/MediaDevices.html +0 -1
- package/docs/index.html +0 -100
- package/docs/interfaces/CertificateEntry.html +0 -4
- package/docs/interfaces/ClientMonitor.ClientMonitor-1.html +0 -82
- package/docs/interfaces/CodecEntry.html +0 -6
- package/docs/interfaces/ContributingSourceEntry.html +0 -4
- package/docs/interfaces/DataChannelEntry.html +0 -4
- package/docs/interfaces/IceCandidatePairEntry.html +0 -4
- package/docs/interfaces/IceServerEntry.html +0 -4
- package/docs/interfaces/InboundRtpEntry.html +0 -14
- package/docs/interfaces/LocalCandidateEntry.html +0 -4
- package/docs/interfaces/MediaSourceEntry.html +0 -4
- package/docs/interfaces/OutboundRtpEntry.html +0 -10
- package/docs/interfaces/PcStatsCollector.html +0 -9
- package/docs/interfaces/PeerConnectionEntry.html +0 -6
- package/docs/interfaces/ReceiverEntry.html +0 -5
- package/docs/interfaces/RemoteCandidateEntry.html +0 -4
- package/docs/interfaces/RemoteInboundRtpEntry.html +0 -8
- package/docs/interfaces/RemoteOutboundRtpEntry.html +0 -8
- package/docs/interfaces/SctpTransportEntry.html +0 -4
- package/docs/interfaces/SenderEntry.html +0 -5
- package/docs/interfaces/StatsReader.html +0 -41
- package/docs/interfaces/TransceiverEntry.html +0 -4
- package/docs/interfaces/TransportEntry.html +0 -4
- package/docs/modules/ClientMonitor.html +0 -33
- package/docs/modules.html +0 -1
- package/figures/navigation.png +0 -0
- package/figures/navigation.puml +0 -150
- package/lib/EventsRelayer.d.ts +0 -47
- package/lib/EventsRelayer.d.ts.map +0 -1
- package/lib/EventsRelayer.js +0 -73
- package/lib/Sender.d.ts +0 -43
- package/lib/Sender.d.ts.map +0 -1
- package/lib/Sender.js +0 -157
- package/lib/codecs/Base64Codec.d.ts +0 -12
- package/lib/codecs/Base64Codec.d.ts.map +0 -1
- package/lib/codecs/Base64Codec.js +0 -25
- package/lib/codecs/Codec.d.ts +0 -11
- package/lib/codecs/Codec.d.ts.map +0 -1
- package/lib/codecs/Codec.js +0 -52
- package/lib/codecs/FacadedCodec.d.ts +0 -10
- package/lib/codecs/FacadedCodec.d.ts.map +0 -1
- package/lib/codecs/FacadedCodec.js +0 -34
- package/lib/codecs/JsonCodec.d.ts +0 -12
- package/lib/codecs/JsonCodec.d.ts.map +0 -1
- package/lib/codecs/JsonCodec.js +0 -30
- package/lib/codecs/ProtobufCodec.d.ts +0 -14
- package/lib/codecs/ProtobufCodec.d.ts.map +0 -1
- package/lib/codecs/ProtobufCodec.js +0 -67
- package/lib/codecs/TextCodec.d.ts +0 -14
- package/lib/codecs/TextCodec.d.ts.map +0 -1
- package/lib/codecs/TextCodec.js +0 -22
- package/lib/transports/Transport.d.ts +0 -16
- package/lib/transports/Transport.d.ts.map +0 -1
- package/lib/transports/Transport.js +0 -16
- package/lib/transports/WebsocketTransport.d.ts +0 -58
- package/lib/transports/WebsocketTransport.d.ts.map +0 -1
- package/lib/transports/WebsocketTransport.js +0 -217
- package/lib/utils/hash.d.ts.map +0 -1
- package/src/EventsRelayer.ts +0 -119
- package/src/Sender.ts +0 -190
- package/src/codecs/Base64Codec.ts +0 -32
- package/src/codecs/Codec.ts +0 -38
- package/src/codecs/FacadedCodec.ts +0 -36
- package/src/codecs/JsonCodec.ts +0 -39
- package/src/codecs/ProtobufCodec.ts +0 -53
- package/src/codecs/TextCodec.ts +0 -32
- package/src/transports/Transport.ts +0 -30
- package/src/transports/WebsocketTransport.ts +0 -260
- package/tests/Accumulator.spec.ts +0 -74
- package/tests/Collectors.spec.ts +0 -373
- package/tests/EventsRelayer.spec.ts +0 -122
- package/tests/Metrics.spec.ts +0 -40
- package/tests/Sampler.spec.ts +0 -237
- package/tests/Sender.spec.ts +0 -7
- package/tests/adapters/Adapter.spec.ts +0 -39
- package/tests/adapters/ChromeAdapter86.spec.ts +0 -62
- package/tests/adapters/DefaultAdapter.spec.ts +0 -6
- package/tests/adapters/Firefox94Adapter.spec.ts +0 -92
- package/tests/adapters/Safari14Adapter.spec.ts +0 -66
- package/tests/codecs/Base64Codec.spec.ts +0 -10
- package/tests/codecs/FacadedCodec.spec.ts +0 -18
- package/tests/codecs/JsonCodec.spec.ts +0 -10
- package/tests/codecs/ProtobufCodec.spec.ts +0 -41
- package/tests/codecs/TextCodec.spec.ts +0 -12
- package/tests/entries/StatsStorage.spec.ts +0 -399
- package/tests/helpers/ClientMonitorGenerator.ts +0 -173
- package/tests/helpers/StatsGenerator.ts +0 -310
- package/tests/helpers/createBaseAdapterTests.ts +0 -192
- package/tests/transports/WebsocketTransport.spec.ts +0 -17
- package/tests/utils/MediaDevices.spec.ts +0 -68
- package/tests/utils/Timer.spec.ts +0 -167
- package/tests/utils/common.spec.ts +0 -113
- package/tests/utils/hash.spec.ts +0 -110
- package/tests/utils/validators.spec.ts +0 -35
package/lib/Accumulator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ClientSample, Samples } from
|
|
2
|
-
export
|
|
1
|
+
import { ClientSample, Samples } from '@observertc/sample-schemas-js';
|
|
2
|
+
export type AccumulatorConfig = {
|
|
3
3
|
/**
|
|
4
4
|
* Sets the maximum number of client sample allowed to be in one Sample
|
|
5
5
|
*
|
|
@@ -19,7 +19,7 @@ export declare type AccumulatorConfig = {
|
|
|
19
19
|
*/
|
|
20
20
|
forwardIfEmpty?: boolean;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type SamplesListener = (samples?: Samples) => void;
|
|
23
23
|
export declare class Accumulator {
|
|
24
24
|
static create(config?: AccumulatorConfig): Accumulator;
|
|
25
25
|
private _samples;
|
package/lib/Accumulator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accumulator.d.ts","sourceRoot":"","sources":["../src/Accumulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Accumulator.d.ts","sourceRoot":"","sources":["../src/Accumulator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAKtE,MAAM,MAAM,iBAAiB,GAAG;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAWF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;AAE1D,qBAAa,WAAW;WACN,MAAM,CAAC,MAAM,CAAC,EAAE,iBAAiB;IAM/C,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,OAAO,CAAiB;IAChC,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,OAAO,CAAoB;gBAChB,MAAM,EAAE,iBAAiB;IAI5C,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,OAAO,CAAC,QAAQ,EAAE,eAAe;IAejC,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;IAaxD,OAAO,CAAC,UAAU;CAYrB"}
|
package/lib/Accumulator.js
CHANGED
|
@@ -12,6 +12,10 @@ const supplyDefaultConfig = () => {
|
|
|
12
12
|
return defaultConfig;
|
|
13
13
|
};
|
|
14
14
|
class Accumulator {
|
|
15
|
+
static create(config) {
|
|
16
|
+
const appliedConfig = Object.assign(supplyDefaultConfig(), config);
|
|
17
|
+
return new Accumulator(appliedConfig);
|
|
18
|
+
}
|
|
15
19
|
constructor(config) {
|
|
16
20
|
// the first message constains the schema version
|
|
17
21
|
this._samples = {};
|
|
@@ -19,10 +23,6 @@ class Accumulator {
|
|
|
19
23
|
this._empty = true;
|
|
20
24
|
this._config = config;
|
|
21
25
|
}
|
|
22
|
-
static create(config) {
|
|
23
|
-
const appliedConfig = Object.assign(supplyDefaultConfig(), config);
|
|
24
|
-
return new Accumulator(appliedConfig);
|
|
25
|
-
}
|
|
26
26
|
get isEmpty() {
|
|
27
27
|
return this._empty;
|
|
28
28
|
}
|
package/lib/ClientDevices.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OperationSystem, Browser, Platform, Engine } from "@observertc/sample-schemas-js";
|
|
2
2
|
export declare class ClientDevices {
|
|
3
3
|
private _os;
|
|
4
4
|
private _browser;
|
|
5
5
|
private _platform;
|
|
6
6
|
private _engine;
|
|
7
7
|
private _warned;
|
|
8
|
-
private
|
|
8
|
+
private _actualStamps?;
|
|
9
9
|
private _pivotHashes?;
|
|
10
10
|
constructor();
|
|
11
11
|
collect(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientDevices.d.ts","sourceRoot":"","sources":["../src/ClientDevices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClientDevices.d.ts","sourceRoot":"","sources":["../src/ClientDevices.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAkC3F,qBAAa,aAAa;IACtB,OAAO,CAAC,GAAG,CAA+B;IAC1C,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,SAAS,CAA8B;IAC/C,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,YAAY,CAAC,CAAS;;IAMvB,OAAO;IAyBd,IAAW,EAAE,IAAI,eAAe,CAE/B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,QAAQ,IAAI,QAAQ,CAE9B;IAED,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAED,IAAW,iBAAiB,IAAI,OAAO,CAEtC;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEM,KAAK,IAAI,IAAI;CAKvB"}
|
package/lib/ClientDevices.js
CHANGED
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ClientDevices = void 0;
|
|
27
27
|
const Bowser = __importStar(require("bowser"));
|
|
28
28
|
const logger_1 = require("./utils/logger");
|
|
29
|
-
const
|
|
29
|
+
const makeStamp_1 = require("./utils/makeStamp");
|
|
30
30
|
// import * as proto from "./ProtobufSamples"
|
|
31
31
|
const logger = (0, logger_1.createLogger)("ClientDevices");
|
|
32
32
|
const UNKNOWN_OS = {
|
|
@@ -77,11 +77,11 @@ class ClientDevices {
|
|
|
77
77
|
logger.warn(`Cannot collect media devices and navigator data, because an error occurred`, err);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
this.
|
|
81
|
-
os: (0,
|
|
82
|
-
browser: (0,
|
|
83
|
-
platform: (0,
|
|
84
|
-
engine: (0,
|
|
80
|
+
this._actualStamps = {
|
|
81
|
+
os: (0, makeStamp_1.makeStamp)(this._os),
|
|
82
|
+
browser: (0, makeStamp_1.makeStamp)(this._browser),
|
|
83
|
+
platform: (0, makeStamp_1.makeStamp)(this._platform),
|
|
84
|
+
engine: (0, makeStamp_1.makeStamp)(this._engine),
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
get os() {
|
|
@@ -98,26 +98,26 @@ class ClientDevices {
|
|
|
98
98
|
}
|
|
99
99
|
get isOsChanged() {
|
|
100
100
|
var _a, _b;
|
|
101
|
-
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.os) !== ((_b = this.
|
|
101
|
+
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.os) !== ((_b = this._actualStamps) === null || _b === void 0 ? void 0 : _b.os);
|
|
102
102
|
}
|
|
103
103
|
get isBrowserChanged() {
|
|
104
104
|
var _a, _b;
|
|
105
|
-
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.browser) !== ((_b = this.
|
|
105
|
+
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.browser) !== ((_b = this._actualStamps) === null || _b === void 0 ? void 0 : _b.browser);
|
|
106
106
|
}
|
|
107
107
|
get isPlatformChanged() {
|
|
108
108
|
var _a, _b;
|
|
109
|
-
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.platform) !== ((_b = this.
|
|
109
|
+
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.platform) !== ((_b = this._actualStamps) === null || _b === void 0 ? void 0 : _b.platform);
|
|
110
110
|
}
|
|
111
111
|
get isEngineChanged() {
|
|
112
112
|
var _a, _b;
|
|
113
|
-
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.engine) !== ((_b = this.
|
|
113
|
+
return ((_a = this._pivotHashes) === null || _a === void 0 ? void 0 : _a.engine) !== ((_b = this._actualStamps) === null || _b === void 0 ? void 0 : _b.engine);
|
|
114
114
|
}
|
|
115
115
|
get changed() {
|
|
116
116
|
return this.isOsChanged || this.isBrowserChanged || this.isPlatformChanged || this.isEngineChanged;
|
|
117
117
|
}
|
|
118
118
|
pivot() {
|
|
119
119
|
this._pivotHashes = {
|
|
120
|
-
...this.
|
|
120
|
+
...this._actualStamps,
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
}
|
package/lib/ClientMonitor.d.ts
CHANGED
|
@@ -1,222 +1,241 @@
|
|
|
1
|
-
import { OperationSystem, Browser, Platform, Engine, MediaDevice, ExtensionStat,
|
|
1
|
+
import { OperationSystem, Browser, Platform, Engine, MediaDevice, CustomCallEvent, ExtensionStat, ClientSample, Samples } from "@observertc/sample-schemas-js";
|
|
2
2
|
import { AccumulatorConfig } from "./Accumulator";
|
|
3
3
|
import { Collectors, CollectorsConfig } from "./Collectors";
|
|
4
4
|
import { StatsReader } from "./entries/StatsStorage";
|
|
5
|
-
import { EventsRegister } from "./EventsRelayer";
|
|
6
5
|
import { MetricsReader } from "./Metrics";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
export
|
|
6
|
+
import { TrackRelation } from "./Sampler";
|
|
7
|
+
import { StatsEntry } from "./utils/StatsVisitor";
|
|
8
|
+
export type ClientMonitorConfig = {
|
|
10
9
|
/**
|
|
11
|
-
* Sets the maximum number of listeners for event emitters
|
|
10
|
+
* Sets the maximum number of listeners for event emitters.
|
|
12
11
|
*/
|
|
13
12
|
maxListeners?: number;
|
|
14
13
|
/**
|
|
15
|
-
* By setting
|
|
14
|
+
* By setting this, the observer calls the added statsCollectors periodically
|
|
16
15
|
* and pulls the stats.
|
|
17
16
|
*
|
|
18
17
|
* DEFAULT: undefined
|
|
19
18
|
*/
|
|
20
19
|
collectingPeriodInMs?: number;
|
|
21
20
|
/**
|
|
22
|
-
* By setting
|
|
21
|
+
* By setting this, the observer makes samples periodically.
|
|
23
22
|
*
|
|
24
23
|
* DEFAULT: undefined
|
|
25
24
|
*/
|
|
26
25
|
samplingPeriodInMs?: number;
|
|
27
26
|
/**
|
|
28
|
-
* By setting
|
|
27
|
+
* By setting this, the observer sends the samples periodically.
|
|
29
28
|
*
|
|
30
29
|
* DEFAULT: undefined
|
|
31
30
|
*/
|
|
32
31
|
sendingPeriodInMs?: number;
|
|
33
32
|
/**
|
|
34
|
-
*
|
|
33
|
+
* Sets the ticking time of the timer that invokes processes for collecting, sampling, and sending.
|
|
35
34
|
*
|
|
36
35
|
* DEFAULT: 1000
|
|
37
36
|
*/
|
|
38
37
|
tickingTimeInMs?: number;
|
|
39
38
|
/**
|
|
40
|
-
*
|
|
39
|
+
* Flag indicating if the monitor creates call events.
|
|
40
|
+
* If true, events happening on the collected media source create call events such as MEDIA_TRACK_ADDED or MEDIA_TRACK_REMOVED.
|
|
41
|
+
* Similarly, if a peer connection is added, corresponding call events are generated.
|
|
41
42
|
*
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
statsExpirationTimeInMs?: number;
|
|
45
|
-
/**
|
|
46
|
-
* Collector Component related configurations
|
|
47
|
-
*/
|
|
48
|
-
collectors?: CollectorsConfig;
|
|
49
|
-
/**
|
|
50
|
-
* Sampling Component Related configurations
|
|
43
|
+
* If this flag is false, the application is responsible for adding call events by calling the appropriate ClientMonitor method for the corresponding event.
|
|
51
44
|
*
|
|
45
|
+
* DEFAULT: false
|
|
52
46
|
*/
|
|
53
|
-
|
|
47
|
+
createCallEvents?: boolean;
|
|
54
48
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* default: undefined, means no sample is sent
|
|
49
|
+
* Collector Component related configurations.
|
|
58
50
|
*/
|
|
59
|
-
|
|
51
|
+
collectors?: CollectorsConfig;
|
|
60
52
|
/**
|
|
61
53
|
* If the sender component is configured,
|
|
62
|
-
* accumulator sets the buffer between sampling and sending.
|
|
54
|
+
* the accumulator sets the buffer between sampling and sending.
|
|
63
55
|
*/
|
|
64
56
|
accumulator?: AccumulatorConfig;
|
|
65
57
|
};
|
|
58
|
+
export interface ClientMonitorEvents {
|
|
59
|
+
'stats-collected': {
|
|
60
|
+
stats: StatsEntry[];
|
|
61
|
+
};
|
|
62
|
+
'sample-created': {
|
|
63
|
+
clientSample: ClientSample;
|
|
64
|
+
};
|
|
65
|
+
'send': {
|
|
66
|
+
samples: Samples[];
|
|
67
|
+
};
|
|
68
|
+
}
|
|
66
69
|
/**
|
|
67
70
|
* Client Integration of ObserveRTC to monitor WebRTC clients.
|
|
68
71
|
*/
|
|
69
72
|
export interface ClientMonitor {
|
|
70
73
|
/**
|
|
71
|
-
*
|
|
74
|
+
* The assigned configuration for the ClientMonitor upon creation.
|
|
75
|
+
*/
|
|
76
|
+
readonly config: ClientMonitorConfig;
|
|
77
|
+
/**
|
|
78
|
+
* Information about the operating system from which the observer is obtained.
|
|
72
79
|
*/
|
|
73
80
|
readonly os: OperationSystem;
|
|
74
81
|
/**
|
|
75
|
-
* Information about the browser the observer is obtained.
|
|
82
|
+
* Information about the browser from which the observer is obtained.
|
|
76
83
|
*/
|
|
77
84
|
readonly browser: Browser;
|
|
78
85
|
/**
|
|
79
|
-
* Information about the platform the observer is obtained.
|
|
86
|
+
* Information about the platform from which the observer is obtained.
|
|
80
87
|
*/
|
|
81
88
|
readonly platform: Platform;
|
|
82
89
|
/**
|
|
83
|
-
* Information about the engine the observer is obtained.
|
|
90
|
+
* Information about the engine from which the observer is obtained.
|
|
84
91
|
*/
|
|
85
92
|
readonly engine: Engine;
|
|
86
93
|
/**
|
|
87
|
-
* Iterable iterator for the audio input devices the observer
|
|
94
|
+
* Iterable iterator for the audio input devices obtained by the observer.
|
|
88
95
|
*/
|
|
89
96
|
readonly audioInputs: IterableIterator<MediaDevice>;
|
|
90
97
|
/**
|
|
91
|
-
* Iterable iterator for the audio output devices the observer
|
|
98
|
+
* Iterable iterator for the audio output devices obtained by the observer.
|
|
92
99
|
*/
|
|
93
100
|
readonly audioOutputs: IterableIterator<MediaDevice>;
|
|
94
101
|
/**
|
|
95
|
-
* Iterable iterator for the video input devices the observer
|
|
102
|
+
* Iterable iterator for the video input devices obtained by the observer.
|
|
96
103
|
*/
|
|
97
104
|
readonly videoInputs: IterableIterator<MediaDevice>;
|
|
98
105
|
/**
|
|
99
|
-
*
|
|
106
|
+
* Provides access to the observer's self metrics (last collection time, etc.).
|
|
100
107
|
*/
|
|
101
108
|
readonly metrics: MetricsReader;
|
|
102
109
|
/**
|
|
103
|
-
*
|
|
110
|
+
* Provides access to the collected stats.
|
|
104
111
|
*/
|
|
105
112
|
readonly storage: StatsReader;
|
|
106
113
|
/**
|
|
107
|
-
*
|
|
114
|
+
* Provides access to built-in integrations for different providers.
|
|
108
115
|
*/
|
|
109
|
-
readonly
|
|
116
|
+
readonly collectors: Collectors;
|
|
110
117
|
/**
|
|
111
|
-
*
|
|
118
|
+
* Subscribe to events emitted by the monitor.
|
|
119
|
+
* @param event
|
|
120
|
+
* @param listener
|
|
112
121
|
*/
|
|
113
|
-
|
|
122
|
+
on<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
123
|
+
/**
|
|
124
|
+
* Subscribe to events emitted by the monitor only once.
|
|
125
|
+
* @param event
|
|
126
|
+
* @param listener
|
|
127
|
+
*/
|
|
128
|
+
once<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
129
|
+
/**
|
|
130
|
+
* Unsubscribe from events emitted by the monitor.
|
|
131
|
+
* @param event
|
|
132
|
+
* @param listener
|
|
133
|
+
*/
|
|
134
|
+
off<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
114
135
|
/**
|
|
115
|
-
* Adds a track
|
|
136
|
+
* Adds a track relation to bind tracks to clients and SFUs.
|
|
116
137
|
*
|
|
117
138
|
* @param trackRelation
|
|
118
139
|
*/
|
|
119
140
|
addTrackRelation(trackRelation: TrackRelation): void;
|
|
120
141
|
/**
|
|
121
|
-
* Removes a track relation
|
|
142
|
+
* Removes a track relation associated with the given track id.
|
|
122
143
|
*
|
|
123
144
|
* @param trackId
|
|
124
145
|
*/
|
|
125
146
|
removeTrackRelation(trackId: string): void;
|
|
126
147
|
/**
|
|
127
|
-
*
|
|
128
|
-
* The Monitor adds it to the next sample it creates and
|
|
148
|
+
* Adds the local part of the Session Description Protocol (SDP).
|
|
149
|
+
* The Monitor adds it to the next sample it creates and sends it to the observer.
|
|
129
150
|
* @param localSDP
|
|
130
151
|
*/
|
|
131
152
|
addLocalSDP(localSDP: string[]): void;
|
|
132
153
|
/**
|
|
133
|
-
* Adds media
|
|
134
|
-
* Typically
|
|
154
|
+
* Adds media constraints used to obtain media.
|
|
155
|
+
* Typically, these are the parameters given to MediaDevices.getUserMedia().
|
|
135
156
|
*
|
|
136
|
-
*
|
|
157
|
+
* Constraints added to the observer are sampled by a sampler when a ClientSample is created.
|
|
137
158
|
*
|
|
138
159
|
* @param constrain
|
|
139
160
|
*/
|
|
140
161
|
addMediaConstraints(constrain: MediaStreamConstraints | MediaTrackConstraints): void;
|
|
141
162
|
/**
|
|
142
|
-
* Adds a user media error. Typically this is an error
|
|
163
|
+
* Adds a user media error. Typically, this is an error caught while obtaining getUserMedia from MediaDevices.
|
|
143
164
|
*
|
|
144
|
-
* The obtained user media error is added to the observer
|
|
165
|
+
* The obtained user media error is added to the observer and sampled by a sampler when a ClientSample is created.
|
|
145
166
|
* @param message
|
|
146
167
|
*/
|
|
147
168
|
addUserMediaError(err: any): void;
|
|
148
169
|
/**
|
|
149
|
-
* Adds
|
|
150
|
-
*
|
|
170
|
+
* Adds a MEDIA_TRACK_ADDED type call event
|
|
171
|
+
* @param peerConnectionId - The identifier of the peer connection to which the track is added
|
|
172
|
+
* @param mediaTrackId - The ID of the added track
|
|
173
|
+
* @param timestamp - The timestamp when the event occurred (optional)
|
|
151
174
|
*/
|
|
152
|
-
|
|
175
|
+
addMediaTrackAddedCallEvent(peerConnectionId: string, mediaTrackId: string, timestamp?: number): void;
|
|
153
176
|
/**
|
|
154
|
-
* Adds
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* @param stats arbitrary information intended to send
|
|
177
|
+
* Adds a MEDIA_TRACK_REMOVED type call event
|
|
178
|
+
* @param peerConnectionId - The identifier of the peer connection from which the track is removed
|
|
179
|
+
* @param mediaTrackId - The ID of the removed track
|
|
180
|
+
* @param timestamp - The timestamp when the event occurred (optional)
|
|
160
181
|
*/
|
|
161
|
-
|
|
182
|
+
addMediaTrackRemovedCallEvent(peerConnectionId: string, mediaTrackId: string, timestamp?: number): void;
|
|
162
183
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* The client monitor kepp track of the already added devices, removes the one not updated,
|
|
167
|
-
* and in the next sample sent to the observer only the new devices will be sent
|
|
168
|
-
*
|
|
184
|
+
* Adds a PEER_CONNECTION_OPENED type call event
|
|
185
|
+
* @param peerConnectionId - The identifier of the opened peer connection
|
|
186
|
+
* @param timestamp - The timestamp when the event occurred (optional)
|
|
169
187
|
*/
|
|
170
|
-
|
|
188
|
+
addPeerConnectionOpenedCallEvent(peerConnectionId: string, timestamp?: number): void;
|
|
171
189
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* @param value
|
|
190
|
+
* Adds a PEER_CONNECTION_CLOSED type call event
|
|
191
|
+
* @param peerConnectionId - The identifier of the closed peer connection
|
|
192
|
+
* @param timestamp - The timestamp when the event occurred (optional)
|
|
176
193
|
*/
|
|
177
|
-
|
|
194
|
+
addPeerConnectionClosedCallEvent(peerConnectionId: string, timestamp?: number): void;
|
|
178
195
|
/**
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* @param
|
|
196
|
+
* Adds an ICE_CONNECTION_STATE_CHANGED type call event
|
|
197
|
+
* @param peerConnectionId - The identifier of the peer connection with the changed ICE connection state
|
|
198
|
+
* @param iceConnectionState - The new ICE connection state
|
|
199
|
+
* @param timestamp - The timestamp when the event occurred (optional)
|
|
182
200
|
*/
|
|
183
|
-
|
|
201
|
+
addIceConnectionStateChangedCallEvent(peerConnectionId: string, connectionState: RTCPeerConnectionState, timestamp?: number): void;
|
|
184
202
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* @param value the identifier of the client, must be a valid UUID
|
|
203
|
+
* Adds a custom call event that will be sent along with the sample to the observer. The
|
|
204
|
+
* added event will be reported as a CallEvent by the observer.
|
|
188
205
|
*/
|
|
189
|
-
|
|
206
|
+
addCustomCallEvent(event: CustomCallEvent): void;
|
|
190
207
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
208
|
+
* Adds an application-provided custom payload object to the observer.
|
|
209
|
+
* This is typically extra information that the application wants to obtain and send to the backend.
|
|
210
|
+
* The added information is obtained by the sampler, and the ClientSample holds and sends this information to the observer.
|
|
211
|
+
* The observer will forward this information along with the call it belongs to.
|
|
212
|
+
*
|
|
213
|
+
* @param stats - Arbitrary information intended to be sent
|
|
196
214
|
*/
|
|
197
|
-
|
|
215
|
+
addExtensionStats(stats: ExtensionStat): void;
|
|
198
216
|
/**
|
|
199
|
-
* Sets the
|
|
200
|
-
* Typically this is a
|
|
201
|
-
*
|
|
217
|
+
* Sets the media devices used by the WebRTC app
|
|
218
|
+
* Typically, this is a list of [MediaDevices.getUserMedia()](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia).
|
|
219
|
+
*
|
|
220
|
+
* The client monitor keeps track of the already added devices, removes the ones not updated,
|
|
221
|
+
* and in the next sample sent to the observer, only the new devices will be sent
|
|
202
222
|
*
|
|
203
|
-
* @param marker
|
|
204
223
|
*/
|
|
205
|
-
|
|
224
|
+
setMediaDevices(...devices: MediaDevice[]): void;
|
|
206
225
|
/**
|
|
207
|
-
* Sets the collecting period in milliseconds.
|
|
208
|
-
*
|
|
226
|
+
* Sets the collecting period in milliseconds. The Monitor calls its collect method
|
|
227
|
+
* at the specified time interval.
|
|
209
228
|
*
|
|
210
|
-
* NOTE:
|
|
211
|
-
* @param collectingPeriodInMs
|
|
229
|
+
* NOTE: If a timer has been previously set for collecting, this setting will override it.
|
|
230
|
+
* @param collectingPeriodInMs - Collecting period in milliseconds
|
|
212
231
|
*/
|
|
213
232
|
setCollectingPeriod(collectingPeriodInMs: number): void;
|
|
214
233
|
/**
|
|
215
|
-
* Sets the sampling period in milliseconds.
|
|
216
|
-
*
|
|
234
|
+
* Sets the sampling period in milliseconds. The Monitor calls its sample method
|
|
235
|
+
* at the specified time interval.
|
|
217
236
|
*
|
|
218
|
-
* NOTE:
|
|
219
|
-
* @param samplingPeriodInMs
|
|
237
|
+
* NOTE: If a timer has been previously set for sampling, this setting will override it.
|
|
238
|
+
* @param samplingPeriodInMs - Sampling period in milliseconds
|
|
220
239
|
*/
|
|
221
240
|
setSamplingPeriod(samplingPeriodInMs: number): void;
|
|
222
241
|
/**
|
|
@@ -227,13 +246,6 @@ export interface ClientMonitor {
|
|
|
227
246
|
* @param sendingPeriodInMs
|
|
228
247
|
*/
|
|
229
248
|
setSendingPeriod(sendingPeriodInMs: number): void;
|
|
230
|
-
/**
|
|
231
|
-
* Connect the client monitor to an observer
|
|
232
|
-
*
|
|
233
|
-
* NOTE: if the monitor is already connected then the open connection will be closed first.
|
|
234
|
-
* @param config
|
|
235
|
-
*/
|
|
236
|
-
connect(config: SenderConfig): void;
|
|
237
249
|
/**
|
|
238
250
|
* Collect all stats simultenously and update the #this.stats storage.
|
|
239
251
|
*/
|
|
@@ -246,7 +258,7 @@ export interface ClientMonitor {
|
|
|
246
258
|
* Send Samples to an observer endpoint. [Samples](https://www.npmjs.com/package/@observertc/schemas#Samples) are
|
|
247
259
|
* accumulated ClientSamples (and/or SfuSamples) send to an endpoint for further analysis.
|
|
248
260
|
*/
|
|
249
|
-
send(
|
|
261
|
+
send(): void;
|
|
250
262
|
/**
|
|
251
263
|
* Close the ClientObserver, clear the storage, and statscollectors.
|
|
252
264
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientMonitor.d.ts","sourceRoot":"","sources":["../src/ClientMonitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,O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AE9C;;;;;;;OAOG;IACH,eAAe,CAAC,GAAG,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEjD;;;;;;OAMG;IACH,mBAAmB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD;;;;;;OAMG;IACH,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpD;;;;;;OAMG;IACH,gBAAgB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAElD;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;OAEG;IACH,MAAM,IAAI,IAAI,CAAC;IAEf;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
import { Browser, CustomCallEvent, Engine, ExtensionStat, MediaDevice, OperationSystem, Platform } from "@observertc/monitor-schemas";
|
|
2
|
-
import { EventsRegister } from "./EventsRelayer";
|
|
3
1
|
import { TrackRelation } from "./Sampler";
|
|
4
|
-
import { SenderConfig, SentSamplesCallback } from "./Sender";
|
|
5
2
|
import { StatsReader } from "./entries/StatsStorage";
|
|
6
|
-
import { ClientMonitor, ClientMonitorConfig } from "./ClientMonitor";
|
|
3
|
+
import { ClientMonitor, ClientMonitorConfig, ClientMonitorEvents } from "./ClientMonitor";
|
|
7
4
|
import { MetricsReader } from "./Metrics";
|
|
8
5
|
import { Collectors } from "./Collectors";
|
|
6
|
+
import { OperationSystem, Browser, Platform, Engine, MediaDevice, ExtensionStat, CustomCallEvent } from "@observertc/sample-schemas-js";
|
|
7
|
+
type ConstructorConfig = ClientMonitorConfig;
|
|
9
8
|
export declare class ClientMonitorImpl implements ClientMonitor {
|
|
9
|
+
readonly config: ConstructorConfig;
|
|
10
10
|
static create(config?: ClientMonitorConfig): ClientMonitor;
|
|
11
11
|
private _closed;
|
|
12
|
-
private _flags;
|
|
13
|
-
private _config;
|
|
14
12
|
private _mediaDevices;
|
|
15
13
|
private _clientDevices;
|
|
16
14
|
private _collectors;
|
|
17
15
|
private _sampler;
|
|
18
|
-
private _sender?;
|
|
19
16
|
private _timer?;
|
|
20
|
-
private _eventer;
|
|
21
17
|
private _statsStorage;
|
|
22
18
|
private _accumulator;
|
|
23
19
|
private _metrics;
|
|
20
|
+
private _emitter;
|
|
24
21
|
private constructor();
|
|
25
|
-
get clientId(): string | undefined;
|
|
26
|
-
get callId(): string | undefined;
|
|
27
22
|
get os(): OperationSystem;
|
|
28
23
|
get metrics(): MetricsReader;
|
|
29
24
|
get browser(): Browser;
|
|
@@ -32,35 +27,36 @@ export declare class ClientMonitorImpl implements ClientMonitor {
|
|
|
32
27
|
get audioInputs(): IterableIterator<MediaDevice>;
|
|
33
28
|
get audioOutputs(): IterableIterator<MediaDevice>;
|
|
34
29
|
get videoInputs(): IterableIterator<MediaDevice>;
|
|
35
|
-
get events(): EventsRegister;
|
|
36
30
|
get storage(): StatsReader;
|
|
37
31
|
get collectors(): Collectors;
|
|
38
|
-
setRoomId(value: string): void;
|
|
39
|
-
setClientId(value: string): void;
|
|
40
|
-
setCallId(value: string): void;
|
|
41
|
-
connect(senderConfig: SenderConfig): void;
|
|
42
|
-
disconnect(): void;
|
|
43
32
|
addTrackRelation(trackRelation: TrackRelation): void;
|
|
44
33
|
removeTrackRelation(trackId: string): void;
|
|
45
34
|
setMediaDevices(...devices: MediaDevice[]): void;
|
|
46
|
-
setUserId(value?: string | null): void;
|
|
47
35
|
addMediaConstraints(constrains: MediaStreamConstraints | MediaTrackConstraints): void;
|
|
48
36
|
addUserMediaError(err: any): void;
|
|
37
|
+
addMediaTrackAddedCallEvent(peerConnectionId: string, mediaTrackId: string, timestamp?: number): void;
|
|
38
|
+
addMediaTrackRemovedCallEvent(peerConnectionId: string, mediaTrackId: string, timestamp?: number): void;
|
|
39
|
+
addPeerConnectionOpenedCallEvent(peerConnectionId: string, timestamp?: number): void;
|
|
40
|
+
addPeerConnectionClosedCallEvent(peerConnectionId: string, timestamp?: number): void;
|
|
41
|
+
addIceConnectionStateChangedCallEvent(peerConnectionId: string, connectionState: RTCPeerConnectionState, timestamp?: number): void;
|
|
49
42
|
addExtensionStats(stats: ExtensionStat): void;
|
|
50
43
|
addCustomCallEvent(event: CustomCallEvent): void;
|
|
51
44
|
addLocalSDP(localSDP: string[]): void;
|
|
52
|
-
setMarker(marker: string): void;
|
|
53
45
|
collect(): Promise<void>;
|
|
54
46
|
sample(): void;
|
|
55
|
-
send(
|
|
47
|
+
send(): void;
|
|
56
48
|
close(): void;
|
|
57
49
|
setCollectingPeriod(collectingPeriodInMs: number): void;
|
|
58
50
|
setSamplingPeriod(samplingPeriodInMs: number): void;
|
|
59
51
|
setSendingPeriod(sendingPeriodInMs: number): void;
|
|
52
|
+
on<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
53
|
+
once<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
54
|
+
off<K extends keyof ClientMonitorEvents>(event: K, listener: (data: ClientMonitorEvents[K]) => void): this;
|
|
55
|
+
_emit<K extends keyof ClientMonitorEvents>(event: K, data: ClientMonitorEvents[K]): boolean;
|
|
60
56
|
private _collectClientDevices;
|
|
61
57
|
private _makeCollector;
|
|
62
58
|
private _makeSampler;
|
|
63
|
-
private _createSender;
|
|
64
59
|
private _createTimer;
|
|
65
60
|
}
|
|
61
|
+
export {};
|
|
66
62
|
//# sourceMappingURL=ClientMonitorImpl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClientMonitorImpl.d.ts","sourceRoot":"","sources":["../src/ClientMonitorImpl.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ClientMonitorImpl.d.ts","sourceRoot":"","sources":["../src/ClientMonitorImpl.ts"],"names":[],"mappings":"AAAA,OAAO,EA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