Skip to content

Commit

Permalink
[RUMF-1530] ✨ add compressed_segment_size
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitZugmeyer committed Mar 30, 2023
1 parent 6432c4a commit f065346
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/rum/src/boot/startRecording.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ describe('startRecording', () => {
},
start: jasmine.any(Number),
raw_segment_size: jasmine.any(Number),
compressed_segment_size: jasmine.any(Number),
view: {
id: 'view-id',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('buildReplayPayload', () => {
const METADATA_AND_SEGMENT_SIZES = {
...METADATA,
raw_segment_size: SERIALIZED_SEGMENT.length,
compressed_segment_size: COMPRESSED_SEGMENT.byteLength,
}

it('adds the segment as a file', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { BrowserSegmentMetadata } from '../../types'

export type BrowserSegmentMetadataAndSegmentSizes = BrowserSegmentMetadata & {
raw_segment_size: number
compressed_segment_size: number
}

export function buildReplayPayload(
Expand All @@ -24,6 +25,7 @@ export function buildReplayPayload(
const metadataAndSegmentSizes: BrowserSegmentMetadataAndSegmentSizes = assign(
{
raw_segment_size: rawSegmentBytesCount,
compressed_segment_size: data.byteLength,
},
metadata
)
Expand Down

0 comments on commit f065346

Please sign in to comment.