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
2 changes: 1 addition & 1 deletion packages/@webex/plugin-meetings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"@webex/plugin-people": "workspace:*",
"@webex/plugin-rooms": "workspace:*",
"@webex/ts-sdp": "^1.8.1",
"@webex/web-capabilities": "^1.12.0",
"@webex/web-capabilities": "link:../../../../web-capabilities",

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 Replace the local web-capabilities link

With this dependency set to link:../../../../web-capabilities, a normal checkout does not contain the target (from packages/@webex/plugin-meetings it resolves outside this repo to a sibling web-capabilities; a repo-wide search found no such package). In clean CI or for published consumers without that sibling checkout, the meeting plugin either gets a dangling module link or falls back to an older transitive copy, so the new WasmRuntimeProbe API used by this commit is not reliably available. Please depend on a published version or add it as a real workspace before merging.

Useful? React with 👍 / 👎.

"@webex/webex-core": "workspace:*",
"ampersand-collection": "^2.0.2",
"bowser": "^2.11.0",
Expand Down
29 changes: 22 additions & 7 deletions packages/@webex/plugin-meetings/src/meetings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,34 @@ export default class Meetings extends WebexPlugin {
* @returns {void}
*/
private emitWasmRuntimePerformance = once((correlationId: string): void => {
// This check is designed to swallow any probe/metrics failure so it can never break meeting
// creation, while still reporting the status so we can track browsers with WASM issues.
// Probe and telemetry failures must not prevent meeting creation.
WasmRuntimeProbe.check()
.then((result) => {
const {status, capability, reason, measurements} = result;
const {
divRatio = null,
sqrtRatio = null,
addNsPerOp = null,
addMedianMs = null,
divMedianMs = null,
sqrtMedianMs = null,
} = measurements ?? {};
const measurementsLog = JSON.stringify(measurements);

LoggerProxy.logger.log(
`Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${result.status}, ratio: ${result.ratio}, wasmMs: ${result.wasmMs}, jsMs: ${result.jsMs}`
`Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${status}, capability: ${capability}, reason: ${reason}, measurements: ${measurementsLog}`
);

return Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.WASM_RUNTIME_PERFORMANCE, {
status: result.status,
ratio: result.ratio,
wasmMs: result.wasmMs,
jsMs: result.jsMs,
status,
capability,
reason,
divRatio,
sqrtRatio,
addNsPerOp,
addMedianMs,
divMedianMs,
sqrtMedianMs,
correlation_id: correlationId,
});
})
Expand Down
71 changes: 53 additions & 18 deletions packages/@webex/plugin-meetings/test/unit/spec/meetings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1879,12 +1879,27 @@ describe('plugin-meetings', () => {
});

describe('wasm runtime performance telemetry', () => {
const correlationId = 'wasm-corr-id';
const benchmarkMeasurements = {
divRatio: 1.888,
sqrtRatio: 3.474,
addNsPerOp: 2.006,
addMedianMs: 32.1,
divMedianMs: 60.6,
sqrtMedianMs: 111.5,
};
const probeResult = {
status: 'slow',
capability: 'not capable',
ratio: 0.25,
wasmMs: 25,
jsMs: 100,
reason: null,
measurements: benchmarkMeasurements,
};
const expectedMetricFields = {
status: probeResult.status,
capability: probeResult.capability,
reason: probeResult.reason,
...benchmarkMeasurements,
correlation_id: correlationId,
};
let metricsSpy;
let probeCheckStub;
Expand All @@ -1893,7 +1908,7 @@ describe('plugin-meetings', () => {
webex.meetings.meetingInfo.fetchInfoOptions = sinon.stub().resolves({});
webex.meetings.createMeeting = sinon
.stub()
.returns(Promise.resolve({on: () => true, correlationId: 'wasm-corr-id'}));
.returns(Promise.resolve({on: () => true, correlationId}));
probeCheckStub = sinon.stub(WasmRuntimeProbe, 'check').resolves(probeResult);
metricsSpy = sinon.stub(Metrics, 'sendBehavioralMetric');
});
Expand All @@ -1908,13 +1923,11 @@ describe('plugin-meetings', () => {
await testUtils.flushPromises();

assert.calledOnceWithExactly(probeCheckStub);
assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
status: 'slow',
ratio: 0.25,
wasmMs: 25,
jsMs: 100,
correlation_id: 'wasm-corr-id',
});
assert.calledOnceWithExactly(
metricsSpy,
'js_sdk_wasm_runtime_performance',
expectedMetricFields
);
});

it('logs the WASM runtime status after a meeting is created', async () => {
Expand All @@ -1939,12 +1952,35 @@ describe('plugin-meetings', () => {
await testUtils.flushPromises();

assert.calledOnceWithExactly(probeCheckStub);
assert.calledOnceWithExactly(
metricsSpy,
'js_sdk_wasm_runtime_performance',
expectedMetricFields
);
});

it('emits the reason with null measurement fields when no measurements are available', async () => {
probeCheckStub.resolves({
status: 'unknown',
capability: 'unknown',
reason: 'worker_timeout',
measurements: null,
});

await webex.meetings.create(test1, test2);
await testUtils.flushPromises();

assert.calledOnceWithExactly(metricsSpy, 'js_sdk_wasm_runtime_performance', {
status: 'slow',
ratio: 0.25,
wasmMs: 25,
jsMs: 100,
correlation_id: 'wasm-corr-id',
status: 'unknown',
capability: 'unknown',
reason: 'worker_timeout',
divRatio: null,
sqrtRatio: null,
addNsPerOp: null,
addMedianMs: null,
divMedianMs: null,
sqrtMedianMs: null,
correlation_id: correlationId,
});
});

Expand All @@ -1955,8 +1991,7 @@ describe('plugin-meetings', () => {
const created = await webex.meetings.create(test1, test2);
await testUtils.flushPromises();

// create() resolved normally with the meeting, i.e. the failed probe did not break it.
assert.equal(created.correlationId, 'wasm-corr-id');
assert.equal(created.correlationId, correlationId);
assert.notCalled(metricsSpy);
assert.calledOnceWithExactly(
loggerErrorStub,
Expand Down
8 changes: 7 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8919,7 +8919,7 @@ __metadata:
"@webex/test-helper-retry": "workspace:*"
"@webex/test-helper-test-users": "workspace:*"
"@webex/ts-sdp": ^1.8.1
"@webex/web-capabilities": ^1.12.0
"@webex/web-capabilities": "link:../../../../web-capabilities"
"@webex/webex-core": "workspace:*"
ampersand-collection: ^2.0.2
bowser: ^2.11.0
Expand Down Expand Up @@ -9606,6 +9606,12 @@ __metadata:
languageName: unknown
linkType: soft

"@webex/web-capabilities@link:../../../../web-capabilities::locator=%40webex%2Fplugin-meetings%40workspace%3Apackages%2F%40webex%2Fplugin-meetings":
version: 0.0.0-use.local
resolution: "@webex/web-capabilities@link:../../../../web-capabilities::locator=%40webex%2Fplugin-meetings%40workspace%3Apackages%2F%40webex%2Fplugin-meetings"
languageName: node
linkType: soft

"@webex/web-capabilities@npm:^1.10.0":
version: 1.10.0
resolution: "@webex/web-capabilities@npm:1.10.0"
Expand Down
Loading