Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added meetingJoinPhase to CA metrics #3954

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
ClientEventPayloadError,
ClientSubServiceType,
BrowserLaunchMethodType,
MeetingJoinPhase,
} from '../metrics.types';
import CallDiagnosticEventsBatcher from './call-diagnostic-metrics-batcher';
import PreLoginMetricsBatcher from '../prelogin-metrics-batcher';
Expand Down Expand Up @@ -95,6 +96,7 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
private logger: any; // to avoid adding @ts-ignore everywhere
private hasLoggedBrowserSerial: boolean;
private device: any;
private joinMeetingPhase: MeetingJoinPhase = 'pre-join';

// the default validator before piping an event to the batcher
// this function can be overridden by the user
Expand All @@ -118,6 +120,22 @@ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
this.preLoginMetricsBatcher = new PreLoginMetricsBatcher({}, {parent: this.webex});
}

/**
* Getter - Returns current meetingJoinPhase value
* @returns {string}
*/
get meetingJoinPhase() {
return this.joinMeetingPhase;
}

/**
* Setter - sets meetingJoinPhase value
* @param {string} correlationId
*/
set meetingJoinPhase(joinMeetingPhase: MeetingJoinPhase) {
this.joinMeetingPhase = joinMeetingPhase;
}

/**
* Returns the login type of the current user
* @returns one of 'login-ci','unverified-guest', null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,5 @@ export interface IMetricsAttributes {
meetingId?: string;
callId?: string;
}

export type MeetingJoinPhase = RawEvent['event']['meetingJoinPhase'];
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,22 @@ describe('internal-plugin-metrics', () => {
});
});

describe('#meetingJoinPhase', () => {
it('should have a default value', () => {
const res = cd.meetingJoinPhase;

assert.equal(res, 'pre-join');
});

it('should have a getter and setter', () => {
cd.meetingJoinPhase = 'join';
assert.equal(cd.meetingJoinPhase, 'join');

cd.meetingJoinPhase = 'in-meeting';
assert.equal(cd.meetingJoinPhase, 'in-meeting');
});
});

it('should prepare diagnostic event successfully', () => {
const options = {meetingId: fakeMeeting.id};
const getOriginStub = sinon.stub(cd, 'getOrigin').returns({origin: 'fake-origin'});
Expand Down
Loading