@webex/internal-plugin-metrics 3.0.0-beta.163 → 3.0.0-beta.165
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/call-diagnostic/call-diagnostic-metrics-batcher.js +2 -2
- package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +10 -0
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/types/batcher.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +154 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +324 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +31 -0
- package/dist/types/call-diagnostic/config.d.ts +57 -0
- package/dist/types/call-diagnostic/generated-types-temp/ClientEvent.d.ts +1112 -0
- package/dist/types/call-diagnostic/generated-types-temp/Event.d.ts +4851 -0
- package/dist/types/call-diagnostic/generated-types-temp/MediaQualityEvent.d.ts +2121 -0
- package/dist/types/client-metrics-batcher.d.ts +2 -0
- package/dist/types/config.d.ts +35 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/metrics.d.ts +3 -0
- package/dist/types/metrics.types.d.ts +89 -0
- package/dist/types/new-metrics.d.ts +83 -0
- package/package.json +8 -8
- package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +2 -1
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +11 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +2 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +6 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const CLIENT_NAME: "webex-js-sdk";
|
|
2
|
+
declare namespace _default {
|
|
3
|
+
export namespace device {
|
|
4
|
+
namespace preDiscoveryServices {
|
|
5
|
+
const metricsServiceUrl: string;
|
|
6
|
+
const metrics: string;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export namespace metrics_1 {
|
|
10
|
+
const appType: string;
|
|
11
|
+
const batcherWait: number;
|
|
12
|
+
const batcherMaxCalls: number;
|
|
13
|
+
const batcherMaxWait: number;
|
|
14
|
+
const batcherRetryPlateau: number;
|
|
15
|
+
}
|
|
16
|
+
export { metrics_1 as metrics };
|
|
17
|
+
}
|
|
18
|
+
export default _default;
|
|
19
|
+
export namespace OS_NAME {
|
|
20
|
+
const WINDOWS: string;
|
|
21
|
+
const MAC: string;
|
|
22
|
+
const IOS: string;
|
|
23
|
+
const ANDROID: string;
|
|
24
|
+
const CHROME: string;
|
|
25
|
+
const LINUX: string;
|
|
26
|
+
const OTHERS: string;
|
|
27
|
+
}
|
|
28
|
+
export const OSMap: {
|
|
29
|
+
'Chrome OS': string;
|
|
30
|
+
macOS: string;
|
|
31
|
+
Windows: string;
|
|
32
|
+
iOS: string;
|
|
33
|
+
Android: string;
|
|
34
|
+
Linux: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
|
+
*/
|
|
4
|
+
import '@webex/internal-plugin-device';
|
|
5
|
+
import config from './config';
|
|
6
|
+
import NewMetrics from './new-metrics';
|
|
7
|
+
import { ClientEvent, SubmitBehavioralEvent, SubmitClientEvent, SubmitInternalEvent, SubmitOperationalEvent, SubmitMQE } from './metrics.types';
|
|
8
|
+
import * as CALL_DIAGNOSTIC_CONFIG from './call-diagnostic/config';
|
|
9
|
+
export { default, getOSNameInternal } from './metrics';
|
|
10
|
+
export { config, CALL_DIAGNOSTIC_CONFIG, NewMetrics };
|
|
11
|
+
export type { ClientEvent, SubmitBehavioralEvent, SubmitClientEvent, SubmitInternalEvent, SubmitMQE, SubmitOperationalEvent, };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ClientEvent as RawClientEvent } from './call-diagnostic/generated-types-temp/ClientEvent';
|
|
2
|
+
import { Event as RawEvent } from './call-diagnostic/generated-types-temp/Event';
|
|
3
|
+
import { MediaQualityEvent as RawMediaQualityEvent } from './call-diagnostic/generated-types-temp/MediaQualityEvent';
|
|
4
|
+
export type Event = Omit<RawEvent, 'event'> & {
|
|
5
|
+
event: RawClientEvent | RawMediaQualityEvent;
|
|
6
|
+
};
|
|
7
|
+
export type ClientEventError = NonNullable<RawClientEvent['errors']>[0];
|
|
8
|
+
export type SubmitClientEventOptions = {
|
|
9
|
+
meetingId?: string;
|
|
10
|
+
mediaConnections?: any[];
|
|
11
|
+
rawError?: any;
|
|
12
|
+
showToUser?: boolean;
|
|
13
|
+
correlationId?: string;
|
|
14
|
+
};
|
|
15
|
+
export type SubmitMQEOptions = {
|
|
16
|
+
meetingId: string;
|
|
17
|
+
mediaConnections?: any[];
|
|
18
|
+
networkType?: Event['origin']['networkType'];
|
|
19
|
+
};
|
|
20
|
+
export type InternalEvent = {
|
|
21
|
+
name: 'internal.client.meetinginfo.request' | 'internal.client.meetinginfo.response' | 'internal.reset.join.latencies' | 'internal.client.interstitial-window.launched' | 'internal.client.meeting.click.joinbutton' | 'internal.host.meeting.participant.admitted' | 'internal.client.meeting.interstitial-window.showed' | 'internal.client.pageJMT.received' | 'internal.client.interstitial-window.click.joinbutton';
|
|
22
|
+
payload?: never;
|
|
23
|
+
options?: never;
|
|
24
|
+
};
|
|
25
|
+
export interface ClientEvent {
|
|
26
|
+
name: RawClientEvent['name'];
|
|
27
|
+
payload?: RawClientEvent;
|
|
28
|
+
options: SubmitClientEventOptions;
|
|
29
|
+
}
|
|
30
|
+
export interface BehavioralEvent {
|
|
31
|
+
name: 'host.meeting.participant.admitted' | 'sdk.media-flow.started';
|
|
32
|
+
payload?: never;
|
|
33
|
+
options?: never;
|
|
34
|
+
}
|
|
35
|
+
export interface OperationalEvent {
|
|
36
|
+
name: never;
|
|
37
|
+
payload?: never;
|
|
38
|
+
options?: never;
|
|
39
|
+
}
|
|
40
|
+
export interface FeatureEvent {
|
|
41
|
+
name: never;
|
|
42
|
+
payload?: never;
|
|
43
|
+
options?: never;
|
|
44
|
+
}
|
|
45
|
+
export interface MediaQualityEvent {
|
|
46
|
+
name: RawMediaQualityEvent['name'];
|
|
47
|
+
payload?: RawMediaQualityEvent;
|
|
48
|
+
options: SubmitMQEOptions;
|
|
49
|
+
}
|
|
50
|
+
export type RecursivePartial<T> = {
|
|
51
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
|
|
52
|
+
};
|
|
53
|
+
export type MetricEventNames = InternalEvent['name'] | ClientEvent['name'] | BehavioralEvent['name'] | OperationalEvent['name'] | FeatureEvent['name'] | MediaQualityEvent['name'];
|
|
54
|
+
export type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];
|
|
55
|
+
export type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];
|
|
56
|
+
export type NetworkType = RawEvent['origin']['networkType'];
|
|
57
|
+
export type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;
|
|
58
|
+
export type MediaQualityEventAudioSetupDelayPayload = MediaQualityEvent['payload']['audioSetupDelay'];
|
|
59
|
+
export type MediaQualityEventVideoSetupDelayPayload = MediaQualityEvent['payload']['videoSetupDelay'];
|
|
60
|
+
export type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {
|
|
61
|
+
intervals: MediaQualityEvent['payload']['intervals'];
|
|
62
|
+
};
|
|
63
|
+
export type SubmitInternalEvent = (args: {
|
|
64
|
+
name: InternalEvent['name'];
|
|
65
|
+
payload?: RecursivePartial<InternalEvent['payload']>;
|
|
66
|
+
options: any;
|
|
67
|
+
}) => void;
|
|
68
|
+
export type SubmitBehavioralEvent = (args: {
|
|
69
|
+
name: BehavioralEvent['name'];
|
|
70
|
+
payload?: RecursivePartial<BehavioralEvent['payload']>;
|
|
71
|
+
options: any;
|
|
72
|
+
}) => void;
|
|
73
|
+
export type SubmitClientEvent = (args: {
|
|
74
|
+
name: ClientEvent['name'];
|
|
75
|
+
payload?: RecursivePartial<ClientEvent['payload']>;
|
|
76
|
+
options: SubmitClientEventOptions;
|
|
77
|
+
}) => void;
|
|
78
|
+
export type SubmitOperationalEvent = (args: {
|
|
79
|
+
name: OperationalEvent['name'];
|
|
80
|
+
payload?: RecursivePartial<OperationalEvent['payload']>;
|
|
81
|
+
options: any;
|
|
82
|
+
}) => void;
|
|
83
|
+
export type SubmitMQE = (args: {
|
|
84
|
+
name: MediaQualityEvent['name'];
|
|
85
|
+
payload: RecursivePartial<MediaQualityEvent['payload']> & {
|
|
86
|
+
intervals: MediaQualityEvent['payload']['intervals'];
|
|
87
|
+
};
|
|
88
|
+
options: any;
|
|
89
|
+
}) => void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { WebexPlugin } from '@webex/webex-core';
|
|
2
|
+
import CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';
|
|
3
|
+
import { RecursivePartial, ClientEvent, FeatureEvent, BehavioralEvent, OperationalEvent, MediaQualityEvent, InternalEvent, SubmitClientEventOptions } from './metrics.types';
|
|
4
|
+
import CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';
|
|
5
|
+
/**
|
|
6
|
+
* Metrics plugin to centralize all types of metrics.
|
|
7
|
+
* @class
|
|
8
|
+
*/
|
|
9
|
+
declare class Metrics extends WebexPlugin {
|
|
10
|
+
static instance: Metrics;
|
|
11
|
+
callDiagnosticLatencies: CallDiagnosticLatencies;
|
|
12
|
+
callDiagnosticMetrics: CallDiagnosticMetrics;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor
|
|
15
|
+
* @param args
|
|
16
|
+
* @constructor
|
|
17
|
+
* @private
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
constructor(...args: any[]);
|
|
21
|
+
/**
|
|
22
|
+
* On Ready
|
|
23
|
+
*/
|
|
24
|
+
private onReady;
|
|
25
|
+
/**
|
|
26
|
+
* Used for internal purposes only
|
|
27
|
+
* @param args
|
|
28
|
+
*/
|
|
29
|
+
submitInternalEvent({ name, payload, options, }: {
|
|
30
|
+
name: InternalEvent['name'];
|
|
31
|
+
payload?: RecursivePartial<InternalEvent['payload']>;
|
|
32
|
+
options: any;
|
|
33
|
+
}): void;
|
|
34
|
+
/**
|
|
35
|
+
* Behavioral event
|
|
36
|
+
* @param args
|
|
37
|
+
*/
|
|
38
|
+
submitBehavioralEvent({ name, payload, options, }: {
|
|
39
|
+
name: BehavioralEvent['name'];
|
|
40
|
+
payload?: RecursivePartial<BehavioralEvent['payload']>;
|
|
41
|
+
options: any;
|
|
42
|
+
}): void;
|
|
43
|
+
/**
|
|
44
|
+
* Operational event
|
|
45
|
+
* @param args
|
|
46
|
+
*/
|
|
47
|
+
submitOperationalEvent({ name, payload, options, }: {
|
|
48
|
+
name: OperationalEvent['name'];
|
|
49
|
+
payload?: RecursivePartial<OperationalEvent['payload']>;
|
|
50
|
+
options: any;
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
* Call Analyzer: Media Quality Event
|
|
54
|
+
* @param args
|
|
55
|
+
*/
|
|
56
|
+
submitMQE({ name, payload, options, }: {
|
|
57
|
+
name: MediaQualityEvent['name'];
|
|
58
|
+
payload: RecursivePartial<MediaQualityEvent['payload']> & {
|
|
59
|
+
intervals: MediaQualityEvent['payload']['intervals'];
|
|
60
|
+
};
|
|
61
|
+
options: any;
|
|
62
|
+
}): void;
|
|
63
|
+
/**
|
|
64
|
+
* Call Analyzer: Feature Usage Event
|
|
65
|
+
* @param args
|
|
66
|
+
*/
|
|
67
|
+
submitFeatureEvent({ name, payload, options, }: {
|
|
68
|
+
name: FeatureEvent['name'];
|
|
69
|
+
payload?: RecursivePartial<FeatureEvent['payload']>;
|
|
70
|
+
options: any;
|
|
71
|
+
}): void;
|
|
72
|
+
/**
|
|
73
|
+
* Call Analyzer: Client Event
|
|
74
|
+
* @public
|
|
75
|
+
* @param args
|
|
76
|
+
*/
|
|
77
|
+
submitClientEvent({ name, payload, options, }: {
|
|
78
|
+
name: ClientEvent['name'];
|
|
79
|
+
payload?: RecursivePartial<ClientEvent['payload']>;
|
|
80
|
+
options: SubmitClientEventOptions;
|
|
81
|
+
}): void;
|
|
82
|
+
}
|
|
83
|
+
export default Metrics;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/internal-plugin-metrics",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.165",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@webex/common": "3.0.0-beta.
|
|
32
|
-
"@webex/common-timers": "3.0.0-beta.
|
|
33
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
34
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
35
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
37
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
31
|
+
"@webex/common": "3.0.0-beta.165",
|
|
32
|
+
"@webex/common-timers": "3.0.0-beta.165",
|
|
33
|
+
"@webex/internal-plugin-device": "3.0.0-beta.165",
|
|
34
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.165",
|
|
35
|
+
"@webex/test-helper-chai": "3.0.0-beta.165",
|
|
36
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.165",
|
|
37
|
+
"@webex/webex-core": "3.0.0-beta.165"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -81,9 +81,10 @@ const CallDiagnosticEventsBatcher = Batcher.extend({
|
|
|
81
81
|
joinTimes.localSDPGenRemoteSDPRecv = cdl.getLocalSDPGenRemoteSDPRecv();
|
|
82
82
|
break;
|
|
83
83
|
|
|
84
|
-
// TODO: Figure out equivalent for WEBRTC
|
|
85
84
|
case 'client.media-engine.ready':
|
|
86
85
|
joinTimes.totalMediaJMT = cdl.getTotalMediaJMT();
|
|
86
|
+
joinTimes.interstitialToMediaOKJMT = cdl.getInterstitialToMediaOKJMT();
|
|
87
|
+
joinTimes.callInitMediaEngineReady = cdl.getInterstitialToMediaOKJMT(); // same as interstitialToMediaOKJMT
|
|
87
88
|
break;
|
|
88
89
|
|
|
89
90
|
case 'client.mediaquality.event':
|
|
@@ -267,6 +267,17 @@ export default class CallDiagnosticLatencies {
|
|
|
267
267
|
return undefined;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Interstitial To Media OK JMT
|
|
272
|
+
* @returns - latency
|
|
273
|
+
*/
|
|
274
|
+
public getInterstitialToMediaOKJMT() {
|
|
275
|
+
return this.getDiffBetweenTimestamps(
|
|
276
|
+
'internal.client.interstitial-window.click.joinbutton',
|
|
277
|
+
'client.media-engine.ready'
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
270
281
|
/**
|
|
271
282
|
* Audio setup delay receive
|
|
272
283
|
*/
|
|
@@ -185,6 +185,8 @@ describe('plugin-metrics', () => {
|
|
|
185
185
|
name: 'client.media-engine.ready',
|
|
186
186
|
joinTimes: {
|
|
187
187
|
totalMediaJMT: 30,
|
|
188
|
+
interstitialToMediaOKJMT: 10,
|
|
189
|
+
callInitMediaEngineReady: 10,
|
|
188
190
|
},
|
|
189
191
|
});
|
|
190
192
|
assert.lengthOf(webex.internal.newMetrics.callDiagnosticMetrics.callDiagnosticEventsBatcher.queue, 0);
|
|
@@ -189,5 +189,11 @@ describe("internal-plugin-metrics", () => {
|
|
|
189
189
|
cdl.saveTimestamp('client.media.tx.start', 7);
|
|
190
190
|
assert.deepEqual(cdl.getVideoJoinRespTxStart(), 2);
|
|
191
191
|
});
|
|
192
|
+
|
|
193
|
+
it('calculates getInterstitialToMediaOKJMT correctly', () => {
|
|
194
|
+
cdl.saveTimestamp('internal.client.interstitial-window.click.joinbutton', 5);
|
|
195
|
+
cdl.saveTimestamp('client.media-engine.ready', 7);
|
|
196
|
+
assert.deepEqual(cdl.getInterstitialToMediaOKJMT(), 2);
|
|
197
|
+
});
|
|
192
198
|
})
|
|
193
199
|
})
|