Skip to content
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 @@ -521,11 +521,23 @@ export default class CallDiagnosticLatencies extends WebexPlugin {
* @returns - latency
*/
public getClientJMT() {
const interstitialToJoinOk = this.getInterstitialToJoinOK();
const joinConfJMT = this.getJoinConfJMT();
const clickToInterstitialForClientJmt = this.latencyTimestamps.get(
'internal.click.to.interstitial.for.client.jmt'
);
Comment on lines +524 to +526
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid requiring unset key for getClientJMT

getClientJMT() now depends on latencyTimestamps.get('internal.click.to.interstitial.for.client.jmt'), but this synthetic key is not populated by the normal event-ingestion path in this repo (timestamps are saved from submitted event names in new-metrics.ts), and a repo-wide search shows this key only appears in this method and its unit test. In normal client.locus.join.response processing (call-diagnostic-metrics.util.ts), this makes getClientJMT() return undefined, so joinTimes.clientJmt is no longer produced for existing integrations unless they add a new out-of-band timestamp write.

Useful? React with 👍 / 👎.

Comment on lines +524 to +526
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Read client JMT from the precomputed latency store

The new internal.click.to.interstitial.for.client.jmt key was added to PreComputedLatencies (the values written by saveLatency()/measureLatency()), but getClientJMT() reads it from latencyTimestamps instead of precomputedLatencies. When this latency is recorded through the typed API, getClientJMT() will still see it as missing and return undefined, which drops joinTimes.clientJmt from client.locus.join.response metrics unless callers bypass the normal storage path.

Useful? React with 👍 / 👎.

const interstitialJoinToLocusJoinRequest = this.getDiffBetweenTimestamps(
'internal.client.interstitial-window.click.joinbutton',
'client.locus.join.request'
);

if (typeof interstitialToJoinOk === 'number' && typeof joinConfJMT === 'number') {
return clamp(interstitialToJoinOk - joinConfJMT, 0, this.MAX_INTEGER);
if (
typeof clickToInterstitialForClientJmt === 'number' &&
typeof interstitialJoinToLocusJoinRequest === 'number'
) {
return clamp(
clickToInterstitialForClientJmt + interstitialJoinToLocusJoinRequest,
0,
this.MAX_INTEGER
);
}

return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export type PreComputedLatencies =
| 'internal.get.cluster.time'
| 'internal.click.to.interstitial'
| 'internal.click.to.interstitial.with.user.delay'
| 'internal.click.to.interstitial.for.client.jmt'
| 'internal.refresh.captcha.time'
| 'internal.exchange.ci.token.time'
| 'internal.get.u2c.time'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,10 @@ describe('internal-plugin-metrics', () => {
});

it('calculates getClientJMT correctly', () => {
cdl.saveTimestamp({
key: 'internal.click.to.interstitial.for.client.jmt',
value: 5,
});
cdl.saveTimestamp({
key: 'internal.client.interstitial-window.click.joinbutton',
value: 2,
Expand All @@ -1070,19 +1074,28 @@ describe('internal-plugin-metrics', () => {
key: 'client.locus.join.request',
value: 6,
});
// clickToInterstitialForClientJmt (5) + interstitialJoinToLocusJoinRequest (6 - 2 = 4) = 9
assert.deepEqual(cdl.getClientJMT(), 9);
});

it('returns undefined for getClientJMT when clickToInterstitialForClientJmt is missing', () => {
cdl.saveTimestamp({
key: 'client.locus.join.response',
value: 8,
key: 'internal.client.interstitial-window.click.joinbutton',
value: 2,
});
cdl.saveTimestamp({
key: 'client.ice.start',
value: 10,
key: 'client.locus.join.request',
value: 6,
});
assert.deepEqual(cdl.getClientJMT(), undefined);
});

it('returns undefined for getClientJMT when interstitialJoinToLocusJoinRequest is missing', () => {
cdl.saveTimestamp({
key: 'client.ice.end',
value: 11,
key: 'internal.click.to.interstitial.for.client.jmt',
value: 5,
});
assert.deepEqual(cdl.getClientJMT(), 3);
assert.deepEqual(cdl.getClientJMT(), undefined);
});

it('calculates getAudioJoinRespRxStart correctly', () => {
Expand Down
Loading