@webex/internal-plugin-metrics 3.12.0-next.4 → 3.12.0-next.40
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/automated-user.js +19 -0
- package/dist/automated-user.js.map +1 -0
- package/dist/batcher.js +3 -0
- package/dist/batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +638 -65
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +167 -76
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +5 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +16 -3
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js +4 -0
- package/dist/metrics.types.js.map +1 -1
- package/dist/new-metrics.js +16 -6
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/automated-user.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +67 -14
- package/dist/types/call-diagnostic/config.d.ts +4 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/metrics.types.d.ts +4 -2
- package/dist/types/new-metrics.d.ts +4 -0
- package/package.json +12 -11
- package/src/automated-user.ts +16 -0
- package/src/batcher.js +4 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -73
- package/src/call-diagnostic/call-diagnostic-metrics.ts +101 -15
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
- package/src/call-diagnostic/config.ts +14 -0
- package/src/config.js +1 -0
- package/src/index.ts +5 -0
- package/src/metrics.types.ts +16 -3
- package/src/new-metrics.ts +12 -4
- package/test/unit/spec/automated-user.ts +43 -0
- package/test/unit/spec/batcher.js +43 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +14 -2
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1434 -303
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +852 -159
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
- package/test/unit/spec/new-metrics.ts +39 -2
- package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["metrics.types.ts"],"sourcesContent":["import type {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n FeatureEvent as RawFeatureEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {\n event: RawClientEvent | RawMediaQualityEvent | RawFeatureEvent;\n};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type ClientUserNameInput = NonNullable<RawClientEvent['userNameInput']>;\n\nexport type ClientEmailInput = NonNullable<RawClientEvent['emailInput']>;\n\nexport type BrowserLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['browserLaunchMethod'];\n\nexport type MetricEventProduct = 'webex' | 'wxcc_desktop' | 'wxcc_crm' | 'wxcc_sdk';\n\nexport type MetricEventAgent = 'user' | 'browser' | 'system' | 'sdk' | 'redux' | 'service' | 'api';\n\nexport type MetricEventVerb =\n | 'abort'\n | 'accept'\n | 'activate'\n | 'apply'\n | 'answer'\n | 'authorize'\n | 'build'\n | 'cancel'\n | 'change'\n | 'click'\n | 'close'\n | 'complete'\n | 'connect'\n | 'create'\n | 'deactivate'\n | 'decrypt'\n | 'delete'\n | 'deliver'\n | 'destroy'\n | 'disable'\n | 'disconnect'\n | 'dismiss'\n | 'display'\n | 'download'\n | 'edit'\n | 'enable'\n | 'encrypt'\n | 'end'\n | 'expire'\n | 'fail'\n | 'fetch'\n | 'fire'\n | 'generate'\n | 'get'\n | 'hide'\n | 'hover'\n | 'ignore'\n | 'initialize'\n | 'initiate'\n | 'invalidate'\n | 'join'\n | 'list'\n | 'load'\n | 'login'\n | 'logout'\n | 'notify'\n | 'offer'\n | 'open'\n | 'press'\n | 'receive'\n | 'refer'\n | 'refresh'\n | 'register'\n | 'release'\n | 'reload'\n | 'reject'\n | 'request'\n | 'reset'\n | 'resize'\n | 'respond'\n | 'retry'\n | 'revoke'\n | 'save'\n | 'search'\n | 'select'\n | 'send'\n | 'set'\n | 'sign'\n | 'start'\n | 'submit'\n | 'switch'\n | 'sync'\n | 'toggle'\n | 'transfer'\n | 'unregister'\n | 'update'\n | 'upload'\n | 'use'\n | 'validate'\n | 'view'\n | 'visit'\n | 'wait'\n | 'warn'\n | 'exit';\n\nexport type MetricEventJoinFlowVersion = 'Other' | 'NewFTE';\nexport type MetricEventMeetingJoinPhase = 'pre-join' | 'join' | 'in-meeting';\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n sessionCorrelationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n browserLaunchMethod?: BrowserLaunchMethodType;\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n joinFlowVersion?: MetricEventJoinFlowVersion;\n meetingJoinPhase?: MetricEventMeetingJoinPhase;\n triggeredTime?: string;\n emailInput?: ClientEmailInput;\n userNameInput?: ClientUserNameInput;\n vendorId?: string;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.register.device.request'\n | 'internal.register.device.response'\n | 'internal.reset.join.latencies'\n | 'internal.client.meeting.click.joinbutton'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end'\n | 'internal.client.share.initiated'\n | 'internal.client.share.stopped';\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface DeviceContext {\n app: {version: string};\n device: {id: string};\n locale: string;\n os: {\n name: string;\n version: string;\n };\n}\n\nexport type MetricType = 'behavioral' | 'operational' | 'business';\n\nexport type Table = 'wbxapp_callend_metrics' | 'business_metrics' | 'business_ucf' | 'default';\n\ntype InternalEventPayload = string | number | boolean;\nexport type EventPayload = Record<string, InternalEventPayload>;\nexport type BehavioralEventPayload = EventPayload; // for compatibilty, can be remove after wxcc-desktop did change their imports.\n\nexport interface BusinessEventPayload {\n metricName: string;\n timestamp: number;\n context: DeviceContext;\n browserDetails: object;\n value: EventPayload;\n}\n\nexport interface BusinessEvent {\n type: string[];\n eventPayload: BusinessEventPayload;\n}\n\nexport interface TaggedEvent {\n context: DeviceContext;\n metricName: string;\n tags: EventPayload;\n timestamp: number;\n type: [MetricType];\n}\n\nexport type BehavioralEvent = TaggedEvent;\nexport type OperationalEvent = TaggedEvent;\n\nexport interface FeatureEvent {\n name: RawFeatureEvent['name'];\n payload?: RawFeatureEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['metricName']\n | OperationalEvent['metricName']\n | BusinessEvent['eventPayload']['metricName']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientSubServiceType = ClientEvent['payload']['webexSubServiceType'];\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type ClientFeatureEventPayload = RecursivePartial<FeatureEvent['payload']>;\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['metricName'];\n payload: EventPayload;\n}) => void;\n\nexport type SubmitBusinessEvent = (args: {\n name: OperationalEvent['metricName'];\n payload: EventPayload;\n metadata?: EventPayload;\n table?: Table;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type PreComputedLatencies =\n | 'internal.client.pageJMT'\n | 'internal.download.time'\n | 'internal.get.cluster.time'\n | 'internal.click.to.interstitial'\n | 'internal.click.to.interstitial.with.user.delay'\n | 'internal.refresh.captcha.time'\n | 'internal.exchange.ci.token.time'\n | 'internal.get.u2c.time'\n | 'internal.call.init.join.req'\n | 'internal.other.app.api.time'\n | 'internal.api.fetch.intelligence.models';\n\nexport interface IdType {\n meetingId?: string;\n callId?: string;\n}\n\nexport interface IMetricsAttributes {\n type: string;\n version: string;\n userId: string;\n correlationId: string;\n connectionId: string;\n data: any[];\n meetingId?: string;\n callId?: string;\n}\n\nexport interface DelayedClientEvent {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}\n\nexport type SubmitFeatureEvent = (args: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport interface DelayedClientFeatureEvent {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options?: SubmitClientEventOptions;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["LOCUS_SYNC_LATENCY_EVENT_NAMES","exports"],"sources":["metrics.types.ts"],"sourcesContent":["import type {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n FeatureEvent as RawFeatureEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {\n event: RawClientEvent | RawMediaQualityEvent | RawFeatureEvent;\n};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type ClientUserNameInput = NonNullable<RawClientEvent['userNameInput']>;\n\nexport type ClientEmailInput = NonNullable<RawClientEvent['emailInput']>;\n\nexport type BrowserLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['browserLaunchMethod'];\n\nexport type MetricEventProduct = 'webex' | 'wxcc_desktop' | 'wxcc_crm' | 'wxcc_sdk';\n\nexport type MetricEventAgent = 'user' | 'browser' | 'system' | 'sdk' | 'redux' | 'service' | 'api';\n\nexport type MetricEventVerb =\n | 'abort'\n | 'accept'\n | 'activate'\n | 'apply'\n | 'answer'\n | 'authorize'\n | 'build'\n | 'cancel'\n | 'change'\n | 'click'\n | 'close'\n | 'complete'\n | 'connect'\n | 'create'\n | 'deactivate'\n | 'decrypt'\n | 'delete'\n | 'deliver'\n | 'destroy'\n | 'disable'\n | 'disconnect'\n | 'dismiss'\n | 'display'\n | 'download'\n | 'edit'\n | 'enable'\n | 'encrypt'\n | 'end'\n | 'expire'\n | 'fail'\n | 'fetch'\n | 'fire'\n | 'generate'\n | 'get'\n | 'hide'\n | 'hover'\n | 'ignore'\n | 'initialize'\n | 'initiate'\n | 'invalidate'\n | 'join'\n | 'list'\n | 'load'\n | 'login'\n | 'logout'\n | 'notify'\n | 'offer'\n | 'open'\n | 'press'\n | 'receive'\n | 'refer'\n | 'refresh'\n | 'register'\n | 'release'\n | 'reload'\n | 'reject'\n | 'request'\n | 'reset'\n | 'resize'\n | 'respond'\n | 'retry'\n | 'revoke'\n | 'save'\n | 'search'\n | 'select'\n | 'send'\n | 'set'\n | 'sign'\n | 'start'\n | 'submit'\n | 'switch'\n | 'sync'\n | 'toggle'\n | 'transfer'\n | 'unregister'\n | 'update'\n | 'upload'\n | 'use'\n | 'validate'\n | 'view'\n | 'visit'\n | 'wait'\n | 'warn'\n | 'exit';\n\nexport type MetricEventJoinFlowVersion = 'Other' | 'NewFTE';\nexport type MetricEventMeetingJoinPhase = 'pre-join' | 'join' | 'in-meeting';\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n sessionCorrelationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n browserLaunchMethod?: BrowserLaunchMethodType;\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n joinFlowVersion?: MetricEventJoinFlowVersion;\n meetingJoinPhase?: MetricEventMeetingJoinPhase;\n triggeredTime?: string;\n emailInput?: ClientEmailInput;\n userNameInput?: ClientUserNameInput;\n vendorId?: string;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport const LOCUS_SYNC_LATENCY_EVENT_NAMES = [\n 'internal.client.locus.sync.start',\n 'internal.client.locus.hashtree.request',\n 'internal.client.locus.hashtree.response',\n 'internal.client.locus.sync.request',\n 'internal.client.locus.sync.response',\n 'internal.client.locus.sync.message.received',\n] as const;\n\nexport type LocusSyncLatencyEventName = (typeof LOCUS_SYNC_LATENCY_EVENT_NAMES)[number];\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.register.device.request'\n | 'internal.register.device.response'\n | 'internal.reset.join.latencies'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end'\n | 'internal.client.share.initiated'\n | 'internal.client.share.stopped'\n | LocusSyncLatencyEventName;\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface DeviceContext {\n app: {version: string};\n device: {id: string};\n locale: string;\n os: {\n name: string;\n version: string;\n };\n}\n\nexport type MetricType = 'behavioral' | 'operational' | 'business';\n\nexport type Table = 'wbxapp_callend_metrics' | 'business_metrics' | 'business_ucf' | 'default';\n\ntype InternalEventPayload = string | number | boolean;\nexport type EventPayload = Record<string, InternalEventPayload>;\nexport type BehavioralEventPayload = EventPayload; // for compatibilty, can be remove after wxcc-desktop did change their imports.\n\nexport interface BusinessEventPayload {\n metricName: string;\n timestamp: number;\n context: DeviceContext;\n browserDetails: object;\n value: EventPayload;\n}\n\nexport interface BusinessEvent {\n type: string[];\n eventPayload: BusinessEventPayload;\n}\n\nexport interface TaggedEvent {\n context: DeviceContext;\n metricName: string;\n tags: EventPayload;\n timestamp: number;\n type: [MetricType];\n}\n\nexport type BehavioralEvent = TaggedEvent;\nexport type OperationalEvent = TaggedEvent;\n\nexport interface FeatureEvent {\n name: RawFeatureEvent['name'];\n payload?: RawFeatureEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['metricName']\n | OperationalEvent['metricName']\n | BusinessEvent['eventPayload']['metricName']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientSubServiceType = ClientEvent['payload']['webexSubServiceType'];\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type ClientFeatureEventPayload = RecursivePartial<FeatureEvent['payload']>;\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['metricName'];\n payload: EventPayload;\n}) => void;\n\nexport type SubmitBusinessEvent = (args: {\n name: OperationalEvent['metricName'];\n payload: EventPayload;\n metadata?: EventPayload;\n table?: Table;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type PreComputedLatencies =\n | 'internal.client.pageJMT'\n | 'internal.download.time'\n | 'internal.get.cluster.time'\n | 'internal.click.to.interstitial'\n | 'internal.click.to.interstitial.with.user.delay'\n | 'internal.click.to.interstitial.for.client.jmt'\n | 'internal.refresh.captcha.time'\n | 'internal.exchange.ci.token.time'\n | 'internal.get.u2c.time'\n | 'internal.call.init.join.req'\n | 'internal.other.app.api.time'\n | 'internal.api.fetch.intelligence.models'\n | 'internal.client.locus.sync.random.backoff';\n\nexport interface IdType {\n meetingId?: string;\n callId?: string;\n}\n\nexport interface IMetricsAttributes {\n type: string;\n version: string;\n userId: string;\n correlationId: string;\n connectionId: string;\n data: any[];\n meetingId?: string;\n callId?: string;\n}\n\nexport interface DelayedClientEvent {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}\n\nexport type SubmitFeatureEvent = (args: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport interface DelayedClientFeatureEvent {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options?: SubmitClientEventOptions;\n}\n"],"mappings":";;;;;;;AAuJO,IAAMA,8BAA8B,GAAAC,OAAA,CAAAD,8BAAA,GAAG,CAC5C,kCAAkC,EAClC,wCAAwC,EACxC,yCAAyC,EACzC,oCAAoC,EACpC,qCAAqC,EACrC,6CAA6C,CACrC;;AA8CyC","ignoreList":[]}
|
package/dist/new-metrics.js
CHANGED
|
@@ -26,6 +26,7 @@ var _preloginMetricsBatcher = _interopRequireDefault(require("./prelogin-metrics
|
|
|
26
26
|
var _callDiagnosticMetricsLatencies = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics-latencies"));
|
|
27
27
|
var _callDiagnosticMetrics2 = require("./call-diagnostic/call-diagnostic-metrics.util");
|
|
28
28
|
var _utils = require("./utils");
|
|
29
|
+
var _automatedUser = require("./automated-user");
|
|
29
30
|
var _Metrics;
|
|
30
31
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
31
32
|
/* eslint-disable class-methods-use-this */
|
|
@@ -80,6 +81,10 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
80
81
|
_this.callDiagnosticLatencies = new _callDiagnosticMetricsLatencies.default({}, {
|
|
81
82
|
parent: _this.webex
|
|
82
83
|
});
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
_this.callDiagnosticMetrics = new _callDiagnosticMetrics.default({}, {
|
|
86
|
+
parent: _this.webex
|
|
87
|
+
});
|
|
83
88
|
_this.onReady();
|
|
84
89
|
return _this;
|
|
85
90
|
}
|
|
@@ -94,10 +99,6 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
94
99
|
var _this2 = this;
|
|
95
100
|
// @ts-ignore
|
|
96
101
|
this.webex.once('ready', function () {
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
_this2.callDiagnosticMetrics = new _callDiagnosticMetrics.default({}, {
|
|
99
|
-
parent: _this2.webex
|
|
100
|
-
});
|
|
101
102
|
_this2.preLoginMetrics = new _preloginMetrics.default(
|
|
102
103
|
// @ts-ignore
|
|
103
104
|
new _preloginMetricsBatcher.default({}, {
|
|
@@ -209,6 +210,15 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
209
210
|
return (_this$businessMetrics = (_this$businessMetrics2 = this.businessMetrics) === null || _this$businessMetrics2 === void 0 ? void 0 : _this$businessMetrics2.isReadyToSubmitEvents()) !== null && _this$businessMetrics !== void 0 ? _this$businessMetrics : false;
|
|
210
211
|
}
|
|
211
212
|
|
|
213
|
+
/**
|
|
214
|
+
* @returns whether the current user agent belongs to an automated user
|
|
215
|
+
*/
|
|
216
|
+
}, {
|
|
217
|
+
key: "isAutomatedUser",
|
|
218
|
+
value: function isAutomatedUser() {
|
|
219
|
+
return (0, _automatedUser.isAutomatedUser)();
|
|
220
|
+
}
|
|
221
|
+
|
|
212
222
|
/**
|
|
213
223
|
* Behavioral event
|
|
214
224
|
* @param args
|
|
@@ -336,7 +346,7 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
336
346
|
var name = _ref7.name,
|
|
337
347
|
payload = _ref7.payload,
|
|
338
348
|
options = _ref7.options;
|
|
339
|
-
if (!this.
|
|
349
|
+
if (!this.isReady) {
|
|
340
350
|
// @ts-ignore
|
|
341
351
|
this.webex.logger.log("NewMetrics: @submitFeatureEvent. Attempted to submit before webex.ready. Event name: ".concat(name));
|
|
342
352
|
return _promise.default.resolve();
|
|
@@ -366,7 +376,7 @@ var Metrics = /*#__PURE__*/function (_WebexPlugin) {
|
|
|
366
376
|
var name = _ref8.name,
|
|
367
377
|
payload = _ref8.payload,
|
|
368
378
|
options = _ref8.options;
|
|
369
|
-
if (!this.
|
|
379
|
+
if (!this.isReady) {
|
|
370
380
|
// @ts-ignore
|
|
371
381
|
this.webex.logger.log("NewMetrics: @submitClientEvent. Attempted to submit before webex.ready. Event name: ".concat(name));
|
|
372
382
|
return _promise.default.resolve();
|
package/dist/new-metrics.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_callDiagnosticMetrics","_interopRequireDefault","_behavioralMetrics","_operationalMetrics","_businessMetrics","_preloginMetrics","_preloginMetricsBatcher","_callDiagnosticMetricsLatencies","_callDiagnosticMetrics2","_utils","_Metrics","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","Metrics","_WebexPlugin","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","callDiagnosticLatencies","CallDiagnosticLatencies","parent","webex","onReady","_inherits2","_createClass2","key","value","_this2","once","callDiagnosticMetrics","CallDiagnosticMetrics","preLoginMetrics","PreLoginMetrics","PreLoginMetricsBatcher","isReady","setDelaySubmitClientEvents","shouldDelay","delaySubmitClientEvents","overrides","delayedClientEventsOverrides","submitInternalEvent","_ref","name","payload","options","clearTimestamps","saveTimestamp","lazyBuildBehavioralMetrics","behavioralMetrics","BehavioralMetrics","lazyBuildOperationalMetrics","operationalMetrics","OperationalMetrics","lazyBuildBusinessMetrics","businessMetrics","BusinessMetrics","isReadyToSubmitBehavioralEvents","_this$behavioralMetri","_this$behavioralMetri2","isReadyToSubmitEvents","isReadyToSubmitOperationalEvents","_this$operationalMetr","_this$operationalMetr2","isReadyToSubmitBusinessEvents","_this$businessMetrics","_this$businessMetrics2","submitBehavioralEvent","_ref2","product","agent","target","verb","logger","log","_promise","resolve","submitOperationalEvent","_ref3","submitBusinessEvent","_ref4","table","metadata","submitPreLoginEvent","_ref5","preLoginId","submitMQE","_ref6","submitFeatureEvent","_ref7","meetingId","delaySubmitEvent","delaySubmitClientFeatureEvents","submitClientEvent","_ref8","clientMetricsAliasUser","_this3","request","method","api","resource","headers","body","qs","alias","then","res","catch","err","error","generateCommonErrorMetadata","reject","_buildClientEventFetchRequestOptions","_asyncToGenerator2","_regenerator","mark","_callee","_ref9","wrap","_context","prev","next","abrupt","buildClientEventFetchRequestOptions","stop","_x","setMetricTimingsAndFetch","setTimingsAndFetch","setMetricTimings","isServiceErrorExpected","serviceErrorCode","_ref0","submitDelayedClientEvents","setDelaySubmitClientFeatureEvents","_ref1","delayedClientFeatureEventsOverrides","submitDelayedClientFeatureEvents","WebexPlugin","_default","exports"],"sources":["new-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\n\n// @ts-ignore\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport BehavioralMetrics from './behavioral-metrics';\nimport OperationalMetrics from './operational-metrics';\nimport BusinessMetrics from './business-metrics';\nimport PreLoginMetrics from './prelogin-metrics';\nimport PreLoginMetricsBatcher from './prelogin-metrics-batcher';\nimport {\n RecursivePartial,\n MetricEventProduct,\n MetricEventAgent,\n MetricEventVerb,\n ClientEvent,\n FeatureEvent,\n EventPayload,\n OperationalEvent,\n MediaQualityEvent,\n InternalEvent,\n SubmitClientEventOptions,\n Table,\n DelayedClientEvent,\n DelayedClientFeatureEvent,\n} from './metrics.types';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport {setMetricTimings} from './call-diagnostic/call-diagnostic-metrics.util';\nimport {generateCommonErrorMetadata} from './utils';\n\n/**\n * Metrics plugin to centralize all types of metrics.\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?pageId=231011379\n * @class\n */\nclass Metrics extends WebexPlugin {\n // eslint-disable-next-line no-use-before-define\n static instance: Metrics;\n\n // Call Diagnostic latencies\n callDiagnosticLatencies: CallDiagnosticLatencies;\n // Helper classes to handle the different types of metrics\n callDiagnosticMetrics: CallDiagnosticMetrics;\n behavioralMetrics: BehavioralMetrics;\n operationalMetrics: OperationalMetrics;\n businessMetrics: BusinessMetrics;\n preLoginMetrics: PreLoginMetrics;\n isReady = false;\n\n /**\n * Whether or not to delay the submission of client events.\n */\n delaySubmitClientEvents = false;\n\n /**\n * Whether or not to delay the submission of feature events.\n */\n delaySubmitClientFeatureEvents = false;\n\n /**\n * Overrides for delayed client events. E.g. if you want to override the correlationId for all delayed client events, you can set this to { correlationId: 'newCorrelationId' }\n */\n delayedClientEventsOverrides: Partial<DelayedClientEvent['options']> = {};\n\n delayedClientFeatureEventsOverrides: Partial<DelayedClientFeatureEvent['options']> = {};\n\n /**\n * Constructor\n * @param args\n * @constructor\n * @private\n * @returns\n */\n constructor(...args) {\n super(...args);\n\n // @ts-ignore\n this.callDiagnosticLatencies = new CallDiagnosticLatencies({}, {parent: this.webex});\n this.onReady();\n }\n\n /**\n * On Ready\n */\n private onReady() {\n // @ts-ignore\n this.webex.once('ready', () => {\n // @ts-ignore\n this.callDiagnosticMetrics = new CallDiagnosticMetrics({}, {parent: this.webex});\n this.preLoginMetrics = new PreLoginMetrics(\n // @ts-ignore\n new PreLoginMetricsBatcher({}, {parent: this.webex}),\n {},\n // @ts-ignore\n {parent: this.webex}\n );\n this.isReady = true;\n this.setDelaySubmitClientEvents({\n shouldDelay: this.delaySubmitClientEvents,\n overrides: this.delayedClientEventsOverrides,\n });\n });\n }\n\n /**\n * Used for internal purposes only\n * @param args\n */\n submitInternalEvent({\n name,\n payload,\n options,\n }: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n }) {\n if (name === 'internal.reset.join.latencies') {\n this.callDiagnosticLatencies.clearTimestamps();\n } else {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n }\n }\n\n /**\n * if webex metrics is ready, build behavioral metric backend if not already done.\n */\n private lazyBuildBehavioralMetrics() {\n if (this.isReady && !this.behavioralMetrics) {\n // @ts-ignore\n this.behavioralMetrics = new BehavioralMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * if webex metrics is ready, build operational metric backend if not already done.\n */\n private lazyBuildOperationalMetrics() {\n if (this.isReady && !this.operationalMetrics) {\n // @ts-ignore\n this.operationalMetrics = new OperationalMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * if webex metrics is ready, build business metric backend if not already done.\n */\n private lazyBuildBusinessMetrics() {\n if (this.isReady && !this.businessMetrics) {\n // @ts-ignore\n this.businessMetrics = new BusinessMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * @returns true once we have the deviceId we need to submit behavioral events to Amplitude\n */\n isReadyToSubmitBehavioralEvents() {\n this.lazyBuildBehavioralMetrics();\n\n return this.behavioralMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit operational events\n */\n isReadyToSubmitOperationalEvents() {\n this.lazyBuildOperationalMetrics();\n\n return this.operationalMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit business events\n */\n isReadyToSubmitBusinessEvents() {\n this.lazyBuildBusinessMetrics();\n\n return this.businessMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * Behavioral event\n * @param args\n */\n submitBehavioralEvent({\n product,\n agent,\n target,\n verb,\n payload,\n }: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n }) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitBehavioralEvent. Attempted to submit before webex.ready: ${product}.${agent}.${target}.${verb}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildBehavioralMetrics();\n\n return this.behavioralMetrics.submitBehavioralEvent({product, agent, target, verb, payload});\n }\n\n /**\n * Operational event\n * @param args\n */\n submitOperationalEvent({name, payload}: {name: string; payload?: EventPayload}) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitOperationalEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildOperationalMetrics();\n\n return this.operationalMetrics.submitOperationalEvent({name, payload});\n }\n\n /**\n * Business event\n * @param args\n */\n submitBusinessEvent({\n name,\n payload,\n table,\n metadata,\n }: {\n name: string;\n payload: EventPayload;\n table?: Table;\n metadata?: EventPayload;\n }) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitBusinessEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildBusinessMetrics();\n\n return this.businessMetrics.submitBusinessEvent({name, payload, table, metadata});\n }\n\n /**\n * Call Analyzer: Pre-Login Event\n * @param args\n */\n submitPreLoginEvent({\n name,\n preLoginId,\n payload,\n metadata,\n }: {\n name: string;\n preLoginId: string;\n payload: EventPayload;\n metadata?: EventPayload;\n }): Promise<void> {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitPreLoginEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n return this.preLoginMetrics.submitPreLoginEvent({\n name,\n preLoginId,\n payload,\n metadata,\n });\n }\n\n /**\n * Call Analyzer: Media Quality Event\n * @param args\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: MediaQualityEvent['payload']['intervals'];\n };\n options: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n this.callDiagnosticMetrics.submitMQE({name, payload, options});\n }\n\n /**\n * Call Analyzer: Feature Usage Event\n * @param args\n */\n submitFeatureEvent({\n name,\n payload,\n options,\n }: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options: any;\n }) {\n if (!this.callDiagnosticLatencies || !this.callDiagnosticMetrics) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitFeatureEvent. Attempted to submit before webex.ready. Event name: ${name}`\n );\n\n return Promise.resolve();\n }\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitFeatureEvent({\n name,\n payload,\n options,\n delaySubmitEvent: this.delaySubmitClientFeatureEvents,\n });\n }\n\n /**\n * Call Analyzer: Client Event\n * @public\n * @param args\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n if (!this.callDiagnosticLatencies || !this.callDiagnosticMetrics) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitClientEvent. Attempted to submit before webex.ready. Event name: ${name}`\n );\n\n return Promise.resolve();\n }\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitClientEvent({\n name,\n payload,\n options,\n delaySubmitEvent: this.delaySubmitClientEvents,\n });\n }\n\n /**\n * Issue request to alias a user's pre-login ID with their CI UUID\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n public clientMetricsAliasUser(preLoginId: string) {\n // @ts-ignore\n return this.webex\n .request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics',\n headers: {\n 'x-prelogin-userid': preLoginId,\n },\n body: {},\n qs: {\n alias: true,\n },\n })\n .then((res) => {\n // @ts-ignore\n this.webex.logger.log(`NewMetrics: @clientMetricsAliasUser. Request successful.`);\n\n return res;\n })\n .catch((err) => {\n // @ts-ignore\n this.logger.error(\n `NewMetrics: @clientMetricsAliasUser. Request failed:`,\n `err: ${generateCommonErrorMetadata(err)}`\n );\n\n return Promise.reject(err);\n });\n }\n\n /**\n * Returns a promise that will resolve to fetch options for submitting a metric.\n *\n * This is to support quickly submitting metrics when the browser/tab is closing.\n * Calling submitClientEvent will not work because there some async steps that will\n * not complete before the browser is closed. Instead, we pre-gather all the\n * information/options needed for the request(s), and then simply and quickly\n * fire the fetch(es) when beforeUnload is triggered.\n *\n * We must use fetch instead of request because fetch has a keepalive option that\n * allows the request it to outlive the page.\n *\n * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will\n * properly adjust them before submitting.\n *\n * @public\n * @param {Object} arg\n * @param {String} arg.name - event name\n * @param {Object} arg.payload - event payload\n * @param {Object} arg.options - other options\n * @returns {Promise} promise that resolves to options to be used with fetch\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n return this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n });\n }\n\n /**\n * Submits a metric from pre-built request options via the fetch API. Updates\n * the \"$timings\" and \"originTime\" values to Date.now() since the existing times\n * were set when the options were built (not submitted).\n\n * @param {any} options - the pre-built request options for submitting a metric\n * @returns {Promise} promise that resolves to the response object\n */\n public setMetricTimingsAndFetch(options: any): Promise<any> {\n // @ts-ignore\n return this.webex.setTimingsAndFetch(setMetricTimings(options));\n }\n\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n public isServiceErrorExpected(serviceErrorCode: number): boolean {\n return this.callDiagnosticMetrics.isServiceErrorExpected(serviceErrorCode);\n }\n\n /**\n * Sets the value of delaySubmitClientEvents. If set to true, client events will be delayed until submitDelayedClientEvents is called. If\n * set to false, delayed client events will be submitted.\n *\n * @param {object} options - {shouldDelay: A boolean value indicating whether to delay the submission of client events, overrides: An object containing overrides for the client events}\n */\n public setDelaySubmitClientEvents({\n shouldDelay,\n overrides,\n }: {\n shouldDelay: boolean;\n overrides?: Partial<DelayedClientEvent['options']>;\n }) {\n this.delaySubmitClientEvents = shouldDelay;\n this.delayedClientEventsOverrides = overrides || {};\n\n if (this.isReady && !shouldDelay) {\n return this.callDiagnosticMetrics.submitDelayedClientEvents(overrides);\n }\n\n return Promise.resolve();\n }\n\n /**\n * Sets the value of setDelaySubmitClientFeatureEvents.\n * If set to true, feature events will be delayed until submitDelayedClientFeatureEvents is called.\n * If set to false, delayed feature events will be submitted.\n *\n * @param {object} options - {shouldDelay: A boolean value indicating whether to delay the submission of feature events,\n * overrides: An object containing overrides for the feature events}\n */\n public setDelaySubmitClientFeatureEvents({\n shouldDelay,\n overrides,\n }: {\n shouldDelay: boolean;\n overrides?: Partial<DelayedClientFeatureEvent['options']>;\n }) {\n this.delaySubmitClientFeatureEvents = shouldDelay;\n this.delayedClientFeatureEventsOverrides = overrides || {};\n\n if (this.isReady && !shouldDelay) {\n return this.callDiagnosticMetrics.submitDelayedClientFeatureEvents(overrides);\n }\n\n return Promise.resolve();\n }\n}\n\nexport default Metrics;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,s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AA9I,OAAA,GA2eEU,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_webexCore","require","_callDiagnosticMetrics","_interopRequireDefault","_behavioralMetrics","_operationalMetrics","_businessMetrics","_preloginMetrics","_preloginMetricsBatcher","_callDiagnosticMetricsLatencies","_callDiagnosticMetrics2","_utils","_automatedUser","_Metrics","_callSuper","t","o","e","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","constructor","apply","Boolean","prototype","valueOf","call","Metrics","_WebexPlugin","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","concat","_defineProperty2","callDiagnosticLatencies","CallDiagnosticLatencies","parent","webex","callDiagnosticMetrics","CallDiagnosticMetrics","onReady","_inherits2","_createClass2","key","value","_this2","once","preLoginMetrics","PreLoginMetrics","PreLoginMetricsBatcher","isReady","setDelaySubmitClientEvents","shouldDelay","delaySubmitClientEvents","overrides","delayedClientEventsOverrides","submitInternalEvent","_ref","name","payload","options","clearTimestamps","saveTimestamp","lazyBuildBehavioralMetrics","behavioralMetrics","BehavioralMetrics","lazyBuildOperationalMetrics","operationalMetrics","OperationalMetrics","lazyBuildBusinessMetrics","businessMetrics","BusinessMetrics","isReadyToSubmitBehavioralEvents","_this$behavioralMetri","_this$behavioralMetri2","isReadyToSubmitEvents","isReadyToSubmitOperationalEvents","_this$operationalMetr","_this$operationalMetr2","isReadyToSubmitBusinessEvents","_this$businessMetrics","_this$businessMetrics2","isAutomatedUser","detectAutomatedUser","submitBehavioralEvent","_ref2","product","agent","target","verb","logger","log","_promise","resolve","submitOperationalEvent","_ref3","submitBusinessEvent","_ref4","table","metadata","submitPreLoginEvent","_ref5","preLoginId","submitMQE","_ref6","submitFeatureEvent","_ref7","meetingId","delaySubmitEvent","delaySubmitClientFeatureEvents","submitClientEvent","_ref8","clientMetricsAliasUser","_this3","request","method","api","resource","headers","body","qs","alias","then","res","catch","err","error","generateCommonErrorMetadata","reject","_buildClientEventFetchRequestOptions","_asyncToGenerator2","_regenerator","mark","_callee","_ref9","wrap","_context","prev","next","abrupt","buildClientEventFetchRequestOptions","stop","_x","setMetricTimingsAndFetch","setTimingsAndFetch","setMetricTimings","isServiceErrorExpected","serviceErrorCode","_ref0","submitDelayedClientEvents","setDelaySubmitClientFeatureEvents","_ref1","delayedClientFeatureEventsOverrides","submitDelayedClientFeatureEvents","WebexPlugin","_default","exports"],"sources":["new-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\n\n// @ts-ignore\nimport {WebexPlugin} from '@webex/webex-core';\n\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport BehavioralMetrics from './behavioral-metrics';\nimport OperationalMetrics from './operational-metrics';\nimport BusinessMetrics from './business-metrics';\nimport PreLoginMetrics from './prelogin-metrics';\nimport PreLoginMetricsBatcher from './prelogin-metrics-batcher';\nimport {\n RecursivePartial,\n MetricEventProduct,\n MetricEventAgent,\n MetricEventVerb,\n ClientEvent,\n FeatureEvent,\n EventPayload,\n OperationalEvent,\n MediaQualityEvent,\n InternalEvent,\n SubmitClientEventOptions,\n Table,\n DelayedClientEvent,\n DelayedClientFeatureEvent,\n} from './metrics.types';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport {setMetricTimings} from './call-diagnostic/call-diagnostic-metrics.util';\nimport {generateCommonErrorMetadata} from './utils';\nimport {isAutomatedUser as detectAutomatedUser} from './automated-user';\n\n/**\n * Metrics plugin to centralize all types of metrics.\n * https://confluence-eng-gpk2.cisco.com/conf/pages/viewpage.action?pageId=231011379\n * @class\n */\nclass Metrics extends WebexPlugin {\n // eslint-disable-next-line no-use-before-define\n static instance: Metrics;\n\n // Call Diagnostic latencies\n callDiagnosticLatencies: CallDiagnosticLatencies;\n // Helper classes to handle the different types of metrics\n callDiagnosticMetrics: CallDiagnosticMetrics;\n behavioralMetrics: BehavioralMetrics;\n operationalMetrics: OperationalMetrics;\n businessMetrics: BusinessMetrics;\n preLoginMetrics: PreLoginMetrics;\n isReady = false;\n\n /**\n * Whether or not to delay the submission of client events.\n */\n delaySubmitClientEvents = false;\n\n /**\n * Whether or not to delay the submission of feature events.\n */\n delaySubmitClientFeatureEvents = false;\n\n /**\n * Overrides for delayed client events. E.g. if you want to override the correlationId for all delayed client events, you can set this to { correlationId: 'newCorrelationId' }\n */\n delayedClientEventsOverrides: Partial<DelayedClientEvent['options']> = {};\n\n delayedClientFeatureEventsOverrides: Partial<DelayedClientFeatureEvent['options']> = {};\n\n /**\n * Constructor\n * @param args\n * @constructor\n * @private\n * @returns\n */\n constructor(...args) {\n super(...args);\n\n // @ts-ignore\n this.callDiagnosticLatencies = new CallDiagnosticLatencies({}, {parent: this.webex});\n // @ts-ignore\n this.callDiagnosticMetrics = new CallDiagnosticMetrics({}, {parent: this.webex});\n this.onReady();\n }\n\n /**\n * On Ready\n */\n private onReady() {\n // @ts-ignore\n this.webex.once('ready', () => {\n this.preLoginMetrics = new PreLoginMetrics(\n // @ts-ignore\n new PreLoginMetricsBatcher({}, {parent: this.webex}),\n {},\n // @ts-ignore\n {parent: this.webex}\n );\n this.isReady = true;\n this.setDelaySubmitClientEvents({\n shouldDelay: this.delaySubmitClientEvents,\n overrides: this.delayedClientEventsOverrides,\n });\n });\n }\n\n /**\n * Used for internal purposes only\n * @param args\n */\n submitInternalEvent({\n name,\n payload,\n options,\n }: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n }) {\n if (name === 'internal.reset.join.latencies') {\n this.callDiagnosticLatencies.clearTimestamps();\n } else {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n }\n }\n\n /**\n * if webex metrics is ready, build behavioral metric backend if not already done.\n */\n private lazyBuildBehavioralMetrics() {\n if (this.isReady && !this.behavioralMetrics) {\n // @ts-ignore\n this.behavioralMetrics = new BehavioralMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * if webex metrics is ready, build operational metric backend if not already done.\n */\n private lazyBuildOperationalMetrics() {\n if (this.isReady && !this.operationalMetrics) {\n // @ts-ignore\n this.operationalMetrics = new OperationalMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * if webex metrics is ready, build business metric backend if not already done.\n */\n private lazyBuildBusinessMetrics() {\n if (this.isReady && !this.businessMetrics) {\n // @ts-ignore\n this.businessMetrics = new BusinessMetrics({}, {parent: this.webex});\n }\n }\n\n /**\n * @returns true once we have the deviceId we need to submit behavioral events to Amplitude\n */\n isReadyToSubmitBehavioralEvents() {\n this.lazyBuildBehavioralMetrics();\n\n return this.behavioralMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit operational events\n */\n isReadyToSubmitOperationalEvents() {\n this.lazyBuildOperationalMetrics();\n\n return this.operationalMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * @returns true once we have the deviceId we need to submit business events\n */\n isReadyToSubmitBusinessEvents() {\n this.lazyBuildBusinessMetrics();\n\n return this.businessMetrics?.isReadyToSubmitEvents() ?? false;\n }\n\n /**\n * @returns whether the current user agent belongs to an automated user\n */\n isAutomatedUser() {\n return detectAutomatedUser();\n }\n\n /**\n * Behavioral event\n * @param args\n */\n submitBehavioralEvent({\n product,\n agent,\n target,\n verb,\n payload,\n }: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n }) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitBehavioralEvent. Attempted to submit before webex.ready: ${product}.${agent}.${target}.${verb}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildBehavioralMetrics();\n\n return this.behavioralMetrics.submitBehavioralEvent({product, agent, target, verb, payload});\n }\n\n /**\n * Operational event\n * @param args\n */\n submitOperationalEvent({name, payload}: {name: string; payload?: EventPayload}) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitOperationalEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildOperationalMetrics();\n\n return this.operationalMetrics.submitOperationalEvent({name, payload});\n }\n\n /**\n * Business event\n * @param args\n */\n submitBusinessEvent({\n name,\n payload,\n table,\n metadata,\n }: {\n name: string;\n payload: EventPayload;\n table?: Table;\n metadata?: EventPayload;\n }) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitBusinessEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n this.lazyBuildBusinessMetrics();\n\n return this.businessMetrics.submitBusinessEvent({name, payload, table, metadata});\n }\n\n /**\n * Call Analyzer: Pre-Login Event\n * @param args\n */\n submitPreLoginEvent({\n name,\n preLoginId,\n payload,\n metadata,\n }: {\n name: string;\n preLoginId: string;\n payload: EventPayload;\n metadata?: EventPayload;\n }): Promise<void> {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitPreLoginEvent. Attempted to submit before webex.ready: ${name}`\n );\n\n return Promise.resolve();\n }\n\n return this.preLoginMetrics.submitPreLoginEvent({\n name,\n preLoginId,\n payload,\n metadata,\n });\n }\n\n /**\n * Call Analyzer: Media Quality Event\n * @param args\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: MediaQualityEvent['payload']['intervals'];\n };\n options: any;\n }) {\n this.callDiagnosticLatencies.saveTimestamp({key: name});\n this.callDiagnosticMetrics.submitMQE({name, payload, options});\n }\n\n /**\n * Call Analyzer: Feature Usage Event\n * @param args\n */\n submitFeatureEvent({\n name,\n payload,\n options,\n }: {\n name: FeatureEvent['name'];\n payload?: RecursivePartial<FeatureEvent['payload']>;\n options: any;\n }) {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitFeatureEvent. Attempted to submit before webex.ready. Event name: ${name}`\n );\n\n return Promise.resolve();\n }\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitFeatureEvent({\n name,\n payload,\n options,\n delaySubmitEvent: this.delaySubmitClientFeatureEvents,\n });\n }\n\n /**\n * Call Analyzer: Client Event\n * @public\n * @param args\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n if (!this.isReady) {\n // @ts-ignore\n this.webex.logger.log(\n `NewMetrics: @submitClientEvent. Attempted to submit before webex.ready. Event name: ${name}`\n );\n\n return Promise.resolve();\n }\n this.callDiagnosticLatencies.saveTimestamp({\n key: name,\n options: {meetingId: options?.meetingId},\n });\n\n return this.callDiagnosticMetrics.submitClientEvent({\n name,\n payload,\n options,\n delaySubmitEvent: this.delaySubmitClientEvents,\n });\n }\n\n /**\n * Issue request to alias a user's pre-login ID with their CI UUID\n * @param {string} preLoginId\n * @returns {Object} HttpResponse object\n */\n public clientMetricsAliasUser(preLoginId: string) {\n // @ts-ignore\n return this.webex\n .request({\n method: 'POST',\n api: 'metrics',\n resource: 'clientmetrics',\n headers: {\n 'x-prelogin-userid': preLoginId,\n },\n body: {},\n qs: {\n alias: true,\n },\n })\n .then((res) => {\n // @ts-ignore\n this.webex.logger.log(`NewMetrics: @clientMetricsAliasUser. Request successful.`);\n\n return res;\n })\n .catch((err) => {\n // @ts-ignore\n this.logger.error(\n `NewMetrics: @clientMetricsAliasUser. Request failed:`,\n `err: ${generateCommonErrorMetadata(err)}`\n );\n\n return Promise.reject(err);\n });\n }\n\n /**\n * Returns a promise that will resolve to fetch options for submitting a metric.\n *\n * This is to support quickly submitting metrics when the browser/tab is closing.\n * Calling submitClientEvent will not work because there some async steps that will\n * not complete before the browser is closed. Instead, we pre-gather all the\n * information/options needed for the request(s), and then simply and quickly\n * fire the fetch(es) when beforeUnload is triggered.\n *\n * We must use fetch instead of request because fetch has a keepalive option that\n * allows the request it to outlive the page.\n *\n * Note: the timings values will be wrong, but setMetricTimingsAndFetch() will\n * properly adjust them before submitting.\n *\n * @public\n * @param {Object} arg\n * @param {String} arg.name - event name\n * @param {Object} arg.payload - event payload\n * @param {Object} arg.options - other options\n * @returns {Promise} promise that resolves to options to be used with fetch\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n return this.callDiagnosticMetrics.buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n });\n }\n\n /**\n * Submits a metric from pre-built request options via the fetch API. Updates\n * the \"$timings\" and \"originTime\" values to Date.now() since the existing times\n * were set when the options were built (not submitted).\n\n * @param {any} options - the pre-built request options for submitting a metric\n * @returns {Promise} promise that resolves to the response object\n */\n public setMetricTimingsAndFetch(options: any): Promise<any> {\n // @ts-ignore\n return this.webex.setTimingsAndFetch(setMetricTimings(options));\n }\n\n /**\n * Returns true if the specified serviceErrorCode maps to an expected error.\n * @param {number} serviceErrorCode the service error code\n * @returns {boolean}\n */\n public isServiceErrorExpected(serviceErrorCode: number): boolean {\n return this.callDiagnosticMetrics.isServiceErrorExpected(serviceErrorCode);\n }\n\n /**\n * Sets the value of delaySubmitClientEvents. If set to true, client events will be delayed until submitDelayedClientEvents is called. If\n * set to false, delayed client events will be submitted.\n *\n * @param {object} options - {shouldDelay: A boolean value indicating whether to delay the submission of client events, overrides: An object containing overrides for the client events}\n */\n public setDelaySubmitClientEvents({\n shouldDelay,\n overrides,\n }: {\n shouldDelay: boolean;\n overrides?: Partial<DelayedClientEvent['options']>;\n }) {\n this.delaySubmitClientEvents = shouldDelay;\n this.delayedClientEventsOverrides = overrides || {};\n\n if (this.isReady && !shouldDelay) {\n return this.callDiagnosticMetrics.submitDelayedClientEvents(overrides);\n }\n\n return Promise.resolve();\n }\n\n /**\n * Sets the value of setDelaySubmitClientFeatureEvents.\n * If set to true, feature events will be delayed until submitDelayedClientFeatureEvents is called.\n * If set to false, delayed feature events will be submitted.\n *\n * @param {object} options - {shouldDelay: A boolean value indicating whether to delay the submission of feature events,\n * overrides: An object containing overrides for the feature events}\n */\n public setDelaySubmitClientFeatureEvents({\n shouldDelay,\n overrides,\n }: {\n shouldDelay: boolean;\n overrides?: Partial<DelayedClientFeatureEvent['options']>;\n }) {\n this.delaySubmitClientFeatureEvents = shouldDelay;\n this.delayedClientFeatureEventsOverrides = overrides || {};\n\n if (this.isReady && !shouldDelay) {\n return this.callDiagnosticMetrics.submitDelayedClientFeatureEvents(overrides);\n }\n\n return Promise.resolve();\n }\n}\n\nexport default Metrics;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,mBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,gBAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,gBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,uBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAiBA,IAAAQ,+BAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,uBAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAX,OAAA;AAAwE,IAAAY,QAAA;AAhCxE;AACA;AACA;AAEA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,CAAAC,OAAA,EAAAH,CAAA,OAAAI,2BAAA,CAAAD,OAAA,EAAAJ,CAAA,EAAAM,yBAAA,KAAAC,kBAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,C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AACA;AACA;AACA;AACA;EAPE;IAAAlD,GAAA;IAAAC,KAAA,EAQA,SAAO0G,iCAAiCA,CAAAC,KAAA,EAMrC;MAAA,IALDnG,WAAW,GAAAmG,KAAA,CAAXnG,WAAW;QACXE,SAAS,GAAAiG,KAAA,CAATjG,SAAS;MAKT,IAAI,CAACuD,8BAA8B,GAAGzD,WAAW;MACjD,IAAI,CAACoG,mCAAmC,GAAGlG,SAAS,IAAI,CAAC,CAAC;MAE1D,IAAI,IAAI,CAACJ,OAAO,IAAI,CAACE,WAAW,EAAE;QAChC,OAAO,IAAI,CAACd,qBAAqB,CAACmH,gCAAgC,CAACnG,SAAS,CAAC;MAC/E;MAEA,OAAOsC,QAAA,CAAAhF,OAAA,CAAQiF,OAAO,CAAC,CAAC;IAC1B;EAAC;AAAA,EA/emB6D,sBAAW;AAAApJ,QAAA,GAA3BgB,OAAO;AACX;AAAA,IAAAW,gBAAA,CAAArB,OAAA,EADIU,OAAO;AAAA,IAAAqI,QAAA,GAAAC,OAAA,CAAAhJ,OAAA,GAkfEU,OAAO","ignoreList":[]}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
import { WebexPlugin } from '@webex/webex-core';
|
|
2
2
|
import { MetricEventNames, PreComputedLatencies } from '../metrics.types';
|
|
3
|
+
type SaveTimestampOptions = {
|
|
4
|
+
meetingId?: string;
|
|
5
|
+
dataSetName?: string;
|
|
6
|
+
trackingId?: string;
|
|
7
|
+
};
|
|
8
|
+
type SaveLatencyOptions = {
|
|
9
|
+
accumulate?: boolean;
|
|
10
|
+
meetingId?: string;
|
|
11
|
+
dataSetName?: string;
|
|
12
|
+
};
|
|
13
|
+
type LocusSyncLatencyRecord = {
|
|
14
|
+
meetingId: string;
|
|
15
|
+
dataSetName: string;
|
|
16
|
+
randomBackoffTime: number;
|
|
17
|
+
trackingId?: string;
|
|
18
|
+
syncStart?: number;
|
|
19
|
+
hashTreeRequest?: number;
|
|
20
|
+
hashTreeResponse?: number;
|
|
21
|
+
syncRequest?: number;
|
|
22
|
+
syncResponse?: number;
|
|
23
|
+
messageReceived?: number;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Container for the latencies tracked for a single meeting. Locus sync is currently the only
|
|
27
|
+
* meeting-specific latency we track, but this wrapper lets us add other latency records in the
|
|
28
|
+
* future without changing the shape of `meetingLatencies`.
|
|
29
|
+
*/
|
|
30
|
+
type MeetingLatencyRecord = {
|
|
31
|
+
locusSync: LocusSyncLatencyRecord;
|
|
32
|
+
};
|
|
3
33
|
/**
|
|
4
34
|
* @description Helper class to store latencies timestamp and to calculate various latencies for CA.
|
|
5
35
|
* @exports
|
|
@@ -8,8 +38,12 @@ import { MetricEventNames, PreComputedLatencies } from '../metrics.types';
|
|
|
8
38
|
export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
9
39
|
latencyTimestamps: Map<MetricEventNames, number>;
|
|
10
40
|
precomputedLatencies: Map<PreComputedLatencies, number>;
|
|
41
|
+
meetingLatencies: Map<string, MeetingLatencyRecord[]>;
|
|
11
42
|
private meetingId?;
|
|
12
43
|
private MAX_INTEGER;
|
|
44
|
+
private LOCUS_SYNC_SKEW_THRESHOLD_MS;
|
|
45
|
+
private LOCUS_SYNC_PENDING_RECORD_TTL_MS;
|
|
46
|
+
private LOCUS_SYNC_MAX_RECORDS_PER_DATASET;
|
|
13
47
|
/**
|
|
14
48
|
* @constructor
|
|
15
49
|
*/
|
|
@@ -18,6 +52,164 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
18
52
|
* Clear timestamps
|
|
19
53
|
*/
|
|
20
54
|
clearTimestamps(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Clear tracked Locus sync latency state for a dataset.
|
|
57
|
+
*
|
|
58
|
+
* When a `trackingId` is supplied only the single record matching it is dropped, mirroring the
|
|
59
|
+
* native client which discards the individual in-progress record on a sync error (by syncId).
|
|
60
|
+
* When no `trackingId` is supplied every record for the dataset is dropped (legacy behavior).
|
|
61
|
+
*
|
|
62
|
+
* @param dataSetName dataset name
|
|
63
|
+
* @param meetingId meeting id
|
|
64
|
+
* @param trackingId optional sync tracking id to drop a single record instead of the whole dataset
|
|
65
|
+
*/
|
|
66
|
+
clearLocusSyncLatency(dataSetName: string, meetingId: string, trackingId?: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Calculates Locus sync latency values from stored milestone timestamps.
|
|
69
|
+
* @param meetingId meeting id
|
|
70
|
+
* @param trackingId sync tracking id used to match the record
|
|
71
|
+
* @returns sync latency metrics
|
|
72
|
+
*/
|
|
73
|
+
getLocusSyncLatency(meetingId: string, trackingId: string): {
|
|
74
|
+
totalTime: number;
|
|
75
|
+
syncMessageReceiveTime?: number;
|
|
76
|
+
syncResponseTime?: number;
|
|
77
|
+
randomBackoffTime: number;
|
|
78
|
+
hashtreePrepTime: number;
|
|
79
|
+
hashtreeResponseTime: number;
|
|
80
|
+
syncPrepTime: number;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Records the time the LLM state-update message for a Locus sync arrived. This is the milestone
|
|
84
|
+
* that gates the client.locus.sync.complete metric: the metric is emitted only for flows where
|
|
85
|
+
* the update came over LLM (aligned with the agreed requirement that body/http-only syncs do not
|
|
86
|
+
* emit). The record is matched by meeting id + tracking id, regardless of which other milestones
|
|
87
|
+
* are present yet, so the real arrival time is captured even if the /sync response has not landed.
|
|
88
|
+
* @param meetingId meeting id
|
|
89
|
+
* @param trackingId sync tracking id used to match the pending record
|
|
90
|
+
* @returns void
|
|
91
|
+
*/
|
|
92
|
+
recordLocusSyncMessageReceived(meetingId: string, trackingId: string): void;
|
|
93
|
+
/**
|
|
94
|
+
* Complete and remove the Locus sync latency record for a meeting + tracking id.
|
|
95
|
+
*
|
|
96
|
+
* Both milestones are required, in any arrival order: the metric is emitted only once BOTH the
|
|
97
|
+
* matching LLM broadcast (messageReceived) AND the /sync response have arrived. The LLM broadcast
|
|
98
|
+
* confirms the client that issued the /sync received the resulting state update for its tracking
|
|
99
|
+
* id (so sync cancel, or a sync storm where the final broadcast echoed another client's tracking
|
|
100
|
+
* id, never emit); the /sync response is always waited for too, since the LLM message can arrive
|
|
101
|
+
* before the HTTP response. If either milestone is missing the record is kept so the other can
|
|
102
|
+
* still arrive; it is only consumed when the metric is actually emitted.
|
|
103
|
+
* @param meetingId meeting id
|
|
104
|
+
* @param trackingId sync tracking id used to match the pending record
|
|
105
|
+
* @returns completed sync latency metric payload, or undefined when not completed
|
|
106
|
+
*/
|
|
107
|
+
completeLocusSyncLatency(meetingId: string, trackingId: string): {
|
|
108
|
+
dataSet: string;
|
|
109
|
+
syncLatency: {
|
|
110
|
+
totalTime: number;
|
|
111
|
+
syncMessageReceiveTime?: number;
|
|
112
|
+
syncResponseTime?: number;
|
|
113
|
+
randomBackoffTime: number;
|
|
114
|
+
hashtreePrepTime: number;
|
|
115
|
+
hashtreeResponseTime: number;
|
|
116
|
+
syncPrepTime: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Helper to calculate end - start for Locus sync milestones.
|
|
121
|
+
* @param record tracked milestone timestamps
|
|
122
|
+
* @param a start milestone
|
|
123
|
+
* @param b end milestone
|
|
124
|
+
* @returns latency
|
|
125
|
+
*/
|
|
126
|
+
private getDiffBetweenLocusSyncTimestamps;
|
|
127
|
+
/**
|
|
128
|
+
* Get the timestamp that starts the sync prep segment.
|
|
129
|
+
* @param record tracked milestone timestamps
|
|
130
|
+
* @returns sync prep start milestone
|
|
131
|
+
*/
|
|
132
|
+
private getLocusSyncPrepStart;
|
|
133
|
+
/**
|
|
134
|
+
* Round and clamp Locus sync latency values.
|
|
135
|
+
* @param latency latency value
|
|
136
|
+
* @returns rounded latency
|
|
137
|
+
*/
|
|
138
|
+
private getClampedLocusSyncLatency;
|
|
139
|
+
/**
|
|
140
|
+
* Finds a Locus sync latency record for a meeting using a predicate run against each stored
|
|
141
|
+
* locusSync record.
|
|
142
|
+
* @param meetingId meeting id
|
|
143
|
+
* @param predicate matcher run against each locusSync record
|
|
144
|
+
* @param options.searchFromLatest when true, iterate from the most recently added record first
|
|
145
|
+
* @returns matching Locus sync latency record
|
|
146
|
+
*/
|
|
147
|
+
private findLocusSyncRecord;
|
|
148
|
+
/**
|
|
149
|
+
* Get the Locus sync latency record for a meeting and tracking id.
|
|
150
|
+
* @param meetingId meeting id
|
|
151
|
+
* @param trackingId /sync response tracking id
|
|
152
|
+
* @returns matching Locus sync latency record
|
|
153
|
+
*/
|
|
154
|
+
private getLocusSyncLatencyRecord;
|
|
155
|
+
/**
|
|
156
|
+
* Remove the Locus sync latency record for a meeting and tracking id.
|
|
157
|
+
* @param meetingId meeting id
|
|
158
|
+
* @param trackingId sync tracking id used to match the record
|
|
159
|
+
* @returns void
|
|
160
|
+
*/
|
|
161
|
+
private removeLocusSyncLatencyRecord;
|
|
162
|
+
/**
|
|
163
|
+
* Prune stale never-completed Locus sync latency records for the same dataset as the record that
|
|
164
|
+
* just changed. Records are dropped when they have been pending longer than the TTL, or to keep
|
|
165
|
+
* the number of records per dataset under the safety cap (oldest pending candidates first).
|
|
166
|
+
* @param records current records for the meeting
|
|
167
|
+
* @param changedRecord the record that was just updated, used as the reference point
|
|
168
|
+
* @returns the records to keep
|
|
169
|
+
*/
|
|
170
|
+
private pruneStaleLocusSyncLatencyRecords;
|
|
171
|
+
/**
|
|
172
|
+
* Get the most recent milestone timestamp stored on a Locus sync latency record, checking
|
|
173
|
+
* milestones from latest to earliest so the newest available one is returned.
|
|
174
|
+
* @param record tracked milestone timestamps
|
|
175
|
+
* @returns latest milestone timestamp, or undefined when none are set
|
|
176
|
+
*/
|
|
177
|
+
private getLatestLocusSyncTimestamp;
|
|
178
|
+
/**
|
|
179
|
+
* Persist the Locus sync latency records for a meeting, deleting the meeting entry when no
|
|
180
|
+
* records remain. When pruneOptions is provided, stale records are pruned before saving.
|
|
181
|
+
* @param meetingId meeting id
|
|
182
|
+
* @param records records to save
|
|
183
|
+
* @param pruneOptions when provided, triggers stale record pruning relative to changedRecord
|
|
184
|
+
* @returns void
|
|
185
|
+
*/
|
|
186
|
+
private setMeetingLatencyRecords;
|
|
187
|
+
/**
|
|
188
|
+
* Get the latest Locus sync latency record waiting for sync.start.
|
|
189
|
+
* @param meetingId meeting id
|
|
190
|
+
* @param dataSetName dataset name
|
|
191
|
+
* @returns latest pending Locus sync latency record
|
|
192
|
+
*/
|
|
193
|
+
private getLatestPendingLocusSyncLatencyRecord;
|
|
194
|
+
/**
|
|
195
|
+
* Store random backoff latency for the current or next Locus sync latency record.
|
|
196
|
+
* @param meetingId meeting id
|
|
197
|
+
* @param dataSetName dataset name
|
|
198
|
+
* @param randomBackoffTime random backoff latency value
|
|
199
|
+
* @returns void
|
|
200
|
+
*/
|
|
201
|
+
private saveLocusSyncBackoffLatency;
|
|
202
|
+
/**
|
|
203
|
+
* Checks if metric event name is a Locus sync latency milestone.
|
|
204
|
+
* @param key event name
|
|
205
|
+
* @returns whether event is Locus sync latency milestone
|
|
206
|
+
*/
|
|
207
|
+
private isLocusSyncLatencyEvent;
|
|
208
|
+
/**
|
|
209
|
+
* Stores a Locus sync latency milestone timestamp.
|
|
210
|
+
* @param options options
|
|
211
|
+
*/
|
|
212
|
+
private saveLocusSyncLatencyTimestamp;
|
|
21
213
|
/**
|
|
22
214
|
* Associate current latencies with a meeting id
|
|
23
215
|
* @param meetingId
|
|
@@ -39,19 +231,20 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
39
231
|
saveTimestamp({ key, value, options, }: {
|
|
40
232
|
key: MetricEventNames;
|
|
41
233
|
value?: number;
|
|
42
|
-
options?:
|
|
43
|
-
meetingId?: string;
|
|
44
|
-
};
|
|
234
|
+
options?: SaveTimestampOptions;
|
|
45
235
|
}): void;
|
|
46
236
|
/**
|
|
47
237
|
* Store precomputed latency value
|
|
48
238
|
* @param key - key
|
|
49
239
|
* @param value - value
|
|
50
|
-
* @param
|
|
240
|
+
* @param options - store options (a legacy boolean `accumulate` flag is also accepted)
|
|
241
|
+
* @param options.accumulate - when it is true, it overwrites existing value with sum of the current value and the new measurement otherwise just store the new measurement
|
|
242
|
+
* @param options.meetingId - meeting id, only used for Locus sync latency records
|
|
243
|
+
* @param options.dataSetName - dataset name, only used for Locus sync latency records
|
|
51
244
|
* @throws
|
|
52
245
|
* @returns
|
|
53
246
|
*/
|
|
54
|
-
saveLatency(key: PreComputedLatencies, value: number,
|
|
247
|
+
saveLatency(key: PreComputedLatencies, value: number, options?: SaveLatencyOptions): void;
|
|
55
248
|
/**
|
|
56
249
|
* Measure latency for a request
|
|
57
250
|
* @param callback - callback for which you would like to measure latency
|
|
@@ -149,6 +342,15 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
149
342
|
* @returns - latency
|
|
150
343
|
*/
|
|
151
344
|
getStayLobbyTime(): number;
|
|
345
|
+
/**
|
|
346
|
+
* Stay lobby time capped by a certain timestamp.
|
|
347
|
+
* This is to handle the case where the target end timestamp could happen before the lobby is exited,
|
|
348
|
+
* for example media-engine.ready or client.ice.end
|
|
349
|
+
* This is supposed to be called AFTER the end timestamp happens
|
|
350
|
+
* @param endTimestampKey name of the target end event
|
|
351
|
+
* @returns - latency
|
|
352
|
+
*/
|
|
353
|
+
getStayLobbyTimeCappedBy(endTimestampKey: MetricEventNames): number;
|
|
152
354
|
/**
|
|
153
355
|
* Page JMT
|
|
154
356
|
* @returns - latency
|
|
@@ -258,3 +460,4 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
|
|
|
258
460
|
*/
|
|
259
461
|
getOtherAppApiReqResp(): number;
|
|
260
462
|
}
|
|
463
|
+
export {};
|