-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into centralized-event-buffer
- Loading branch information
Showing
15 changed files
with
246 additions
and
66 deletions.
There are no files selected for viewing
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@newrelic/browser-agent", | ||
"version": "1.264.0", | ||
"version": "1.265.1", | ||
"private": false, | ||
"author": "New Relic Browser Agent Team <[email protected]>", | ||
"description": "New Relic Browser Agent", | ||
|
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
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
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
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 |
---|---|---|
@@ -1,40 +1,40 @@ | ||
const { notIOS, notSafari } = require('../../../tools/browser-matcher/common-matchers.mjs') | ||
const { testSupportMetricsRequest } = require('../../../tools/testing-server/utils/expect-tests') | ||
// const { notIOS, notSafari } = require('../../../tools/browser-matcher/common-matchers.mjs') | ||
// const { testSupportMetricsRequest } = require('../../../tools/testing-server/utils/expect-tests') | ||
|
||
describe('WebSocket supportability metrics', () => { | ||
/** Safari and iOS safari are blocked from connecting to the websocket protocol on LT, which throws socket errors instead of connecting and capturing the expected payloads. | ||
* validated that this works locally for these envs */ | ||
it.withBrowsersMatching([notSafari, notIOS])('should capture expected SMs', async () => { | ||
const supportabilityMetricsRequest = await browser.testHandle.createNetworkCaptures('bamServer', { test: testSupportMetricsRequest }) | ||
const url = await browser.testHandle.assetURL('websockets.html') | ||
// it.withBrowsersMatching([notSafari, notIOS])('should capture expected SMs', async () => { | ||
// const supportabilityMetricsRequest = await browser.testHandle.createNetworkCaptures('bamServer', { test: testSupportMetricsRequest }) | ||
// const url = await browser.testHandle.assetURL('websockets.html') | ||
|
||
await browser.url(url) | ||
.then(() => browser.waitForAgentLoad()) | ||
.then(() => browser.refresh()) | ||
// await browser.url(url) | ||
// .then(() => browser.waitForAgentLoad()) | ||
// .then(() => browser.refresh()) | ||
|
||
const [sms] = await supportabilityMetricsRequest.waitForResult({ totalCount: 1 }) | ||
const smPayload = sms.request.body.sm | ||
const smTags = ['New', 'Open', 'Send', 'Message', 'Close-Clean'] | ||
// const [sms] = await supportabilityMetricsRequest.waitForResult({ totalCount: 1 }) | ||
// const smPayload = sms.request.body.sm | ||
// const smTags = ['New', 'Open', 'Send', 'Message', 'Close-Clean'] | ||
|
||
smTags.forEach(expectedSm => { | ||
const ms = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/Ms`) | ||
const msSinceClassInit = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/MsSinceClassInit`) | ||
const bytes = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/Bytes`) | ||
// smTags.forEach(expectedSm => { | ||
// const ms = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/Ms`) | ||
// const msSinceClassInit = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/MsSinceClassInit`) | ||
// const bytes = smPayload.find(sm => sm.params.name === `WebSocket/${expectedSm}/Bytes`) | ||
|
||
expect(ms).toBeTruthy() | ||
expect(ms.stats.t).toBeGreaterThan(0) | ||
expect(ms.stats.c).toEqual(2) | ||
// expect(ms).toBeTruthy() | ||
// expect(ms.stats.t).toBeGreaterThan(0) | ||
// expect(ms.stats.c).toEqual(2) | ||
|
||
expect(msSinceClassInit).toBeTruthy() | ||
if (expectedSm === 'New') expect(msSinceClassInit.stats.t).toBeLessThanOrEqual(1) | ||
else expect(msSinceClassInit.stats.t).toBeGreaterThan(0) | ||
expect(msSinceClassInit.stats.c).toEqual(2) | ||
// expect(msSinceClassInit).toBeTruthy() | ||
// if (expectedSm === 'New') expect(msSinceClassInit.stats.t).toBeLessThanOrEqual(1) | ||
// else expect(msSinceClassInit.stats.t).toBeGreaterThan(0) | ||
// expect(msSinceClassInit.stats.c).toEqual(2) | ||
|
||
if (['Send', 'Message'].includes(expectedSm)) { | ||
expect(bytes).toBeTruthy() | ||
if (expectedSm === 'Send') expect(bytes.stats.t / bytes.stats.c).toBeGreaterThanOrEqual(8) // we are sending about 8 bytes from client to server | ||
if (expectedSm === 'Message') expect(bytes.stats.t / bytes.stats.c).toBeGreaterThanOrEqual(40) // we are sending about 40 bytes from server to client | ||
} else expect(bytes).toBeFalsy() | ||
}) | ||
}) | ||
// if (['Send', 'Message'].includes(expectedSm)) { | ||
// expect(bytes).toBeTruthy() | ||
// if (expectedSm === 'Send') expect(bytes.stats.t / bytes.stats.c).toBeGreaterThanOrEqual(8) // we are sending about 8 bytes from client to server | ||
// if (expectedSm === 'Message') expect(bytes.stats.t / bytes.stats.c).toBeGreaterThanOrEqual(40) // we are sending about 40 bytes from server to client | ||
// } else expect(bytes).toBeFalsy() | ||
// }) | ||
// }) | ||
}) |
Oops, something went wrong.