Skip to content

Commit a1a7f15

Browse files
chore: Add rrweb node types event size SM (#1592)
Co-authored-by: Jordan Porter <insomniacrampage@hotmail.com>
1 parent fae739a commit a1a7f15

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.github/actions/supportability-check/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const REPO = 'newrelic-browser-agent';
77
const PULL_NUMBER = process.env.PR_NUMBER;
88

99
const SEARCH_STRINGS = ['SUPPORTABILITY_METRIC_CHANNEL', '.reportSupportabilityMetric', 'storeSupportabilityMetrics'];
10-
const SEARCH_FILE = 'supportability_metrics.md';
10+
const SEARCH_FILE = 'docs/supportability-metrics.md';
1111
const SEARCH_DIR = 'src/'; // Change this to your target directory
1212

1313
const octokit = new Octokit({ auth: GITHUB_TOKEN });
@@ -69,4 +69,4 @@ async function main() {
6969

7070
main().catch(err => {
7171
core.setFailed(err.message);
72-
});
72+
});

docs/supportability-metrics.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,3 +429,13 @@ EventBuffer/soft_navigations/Dropped/Bytes
429429
* audit/session_replay/hasError/true/positive
430430
<!--- Session replay had hasError false and no js error harvest occurred (true negative) --->
431431
* audit/session_replay/hasError/true/negative
432+
433+
### Session Replay
434+
<!-- node type 1 = Preload -->
435+
* rrweb/node/1/bytes
436+
<!-- node type 2 = Full snapshot -->
437+
* rrweb/node/2/bytes
438+
<!-- node type 3 = Incremental snapshot -->
439+
* rrweb/node/3/bytes
440+
<!-- node type 4 = Meta -->
441+
* rrweb/node/4/bytes

src/features/session_replay/shared/recorder.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export class Recorder {
180180
const eventBytes = event.__serialized.length
181181
/** The estimated size of the payload after compression */
182182
const payloadSize = this.getPayloadSize(eventBytes)
183+
handle(SUPPORTABILITY_METRIC_CHANNEL, ['rrweb/node/' + event.type + '/bytes', eventBytes], undefined, FEATURE_NAMES.metrics, this.ee)
183184
// Checkout events are flags by the recording lib that indicate a fullsnapshot was taken every n ms. These are important
184185
// to help reconstruct the replay later and must be included. While waiting and buffering for errors to come through,
185186
// each time we see a new checkout, we can drop the old data.

tests/unit/features/session_replay/shared/recorder.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ describe('recorder', () => {
1818
}
1919
},
2020
ee: {
21-
emit: () => {}
21+
emit: () => {},
22+
buffer: () => {}
2223
},
2324
featAggregate: {
2425
gzipper: jest.fn(),

0 commit comments

Comments
 (0)