Skip to content

Commit

Permalink
Merge branch 'next' into fix/contacts/unresolvedContacts
Browse files Browse the repository at this point in the history
  • Loading branch information
sreenara authored Sep 20, 2024
2 parents 28ce611 + 15d6e91 commit b0997bc
Show file tree
Hide file tree
Showing 12 changed files with 628 additions and 226 deletions.
40 changes: 40 additions & 0 deletions packages/@webex/internal-plugin-metrics/src/behavioral-metrics.ts
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});
}
}

This file was deleted.

This file was deleted.

30 changes: 30 additions & 0 deletions packages/@webex/internal-plugin-metrics/src/business-metrics.ts
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});
}
}
Loading

0 comments on commit b0997bc

Please sign in to comment.