-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next' into fix/contacts/unresolvedContacts
- Loading branch information
Showing
12 changed files
with
628 additions
and
226 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/@webex/internal-plugin-metrics/src/behavioral-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {MetricEventProduct, MetricEventAgent, MetricEventVerb, EventPayload} from './metrics.types'; | ||
import GenericMetrics from './generic-metrics'; | ||
|
||
/** | ||
* @description Util class to handle Behavioral Metrics | ||
* @export | ||
* @class BehavioralMetrics | ||
*/ | ||
export default class BehavioralMetrics extends GenericMetrics { | ||
/** | ||
* Submit a behavioral metric to our metrics endpoint. | ||
* @param {MetricEventProduct} product the product from which the metric is being submitted, e.g. 'webex' web client, 'wxcc_desktop' | ||
* @param {MetricEventAgent} agent the source of the action for this metric | ||
* @param {string} target the 'thing' that this metric includes information about | ||
* @param {MetricEventVerb} verb the action that this metric includes information about | ||
* @param {EventPayload} payload information specific to this event. This should be flat, i.e. it should not include nested objects. | ||
* @returns {Promise<any>} | ||
*/ | ||
public submitBehavioralEvent({ | ||
product, | ||
agent, | ||
target, | ||
verb, | ||
payload, | ||
}: { | ||
product: MetricEventProduct; | ||
agent: MetricEventAgent; | ||
target: string; | ||
verb: MetricEventVerb; | ||
payload?: EventPayload; | ||
}) { | ||
const name = `${product}.${agent}.${target}.${verb}`; | ||
const event = this.createTaggedEventObject({ | ||
type: ['behavioral'], | ||
name, | ||
payload, | ||
}); | ||
this.submitEvent({kind: 'behavioral-events -> ', name, event}); | ||
} | ||
} |
179 changes: 0 additions & 179 deletions
179
packages/@webex/internal-plugin-metrics/src/behavioral/behavioral-metrics.ts
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
packages/@webex/internal-plugin-metrics/src/behavioral/config.ts
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
packages/@webex/internal-plugin-metrics/src/business-metrics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import GenericMetrics from './generic-metrics'; | ||
import {EventPayload} from './metrics.types'; | ||
|
||
/** | ||
* @description Util class to handle Buisness Metrics | ||
* @export | ||
* @class BusinessMetrics | ||
*/ | ||
export default class BusinessMetrics extends GenericMetrics { | ||
/** | ||
* Submit a buisness metric to our metrics endpoint. | ||
* @param {string} name of the metric | ||
* @param {EventPayload} user payload of the metric | ||
* @returns {Promise<any>} | ||
*/ | ||
public submitBusinessEvent({name, payload}: {name: string; payload: EventPayload}) { | ||
const event = { | ||
type: ['business'], | ||
eventPayload: { | ||
metricName: name, | ||
timestamp: Date.now(), | ||
context: this.getContext(), | ||
browserDetails: this.getBrowserDetails(), | ||
value: payload, | ||
}, | ||
}; | ||
|
||
this.submitEvent({kind: 'buisness-events -> ', name, event}); | ||
} | ||
} |
Oops, something went wrong.