-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Standardize Feature Buffering Behavior (#1155)
- Loading branch information
1 parent
7b4ab87
commit d070a43
Showing
23 changed files
with
267 additions
and
395 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import { FEATURE_NAMES } from '../../loaders/features/features' | ||
|
||
export const FEATURE_NAME = FEATURE_NAMES.ajax | ||
|
||
export const MAX_PAYLOAD_SIZE = 1000000 |
This file was deleted.
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
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
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,27 +1,34 @@ | ||
import { EventBuffer } from '../../utils/event-buffer' | ||
|
||
export class RecorderEvents { | ||
constructor () { | ||
/** The buffer to hold recorder event nodes */ | ||
this.events = [] | ||
/** Payload metadata -- Should indicate when a replay blob started recording. Resets each time a harvest occurs. | ||
/** The buffer to hold recorder event nodes */ | ||
#events = new EventBuffer(Infinity) | ||
/** Payload metadata -- Should indicate when a replay blob started recording. Resets each time a harvest occurs. | ||
* cycle timestamps are used as fallbacks if event timestamps cannot be used | ||
*/ | ||
this.cycleTimestamp = Date.now() | ||
/** A value which increments with every new mutation node reported. Resets after a harvest is sent */ | ||
this.payloadBytesEstimation = 0 | ||
/** Payload metadata -- Should indicate that the payload being sent has a full DOM snapshot. This can happen | ||
* -- When the recording library begins recording, it starts by taking a DOM snapshot | ||
* -- When visibility changes from "hidden" -> "visible", it must capture a full snapshot for the replay to work correctly across tabs | ||
*/ | ||
this.hasSnapshot = false | ||
/** Payload metadata -- Should indicate that the payload being sent has a meta node. The meta node should always precede a snapshot node. */ | ||
this.hasMeta = false | ||
/** Payload metadata -- Should indicate that the payload being sent contains an error. Used for query/filter purposes in UI */ | ||
this.hasError = false | ||
/** Payload metadata -- Denotes whether all stylesheet elements were able to be inlined */ | ||
this.inlinedAllStylesheets = true | ||
} | ||
cycleTimestamp = Date.now() | ||
/** Payload metadata -- Should indicate that the payload being sent has a full DOM snapshot. This can happen | ||
* -- When the recording library begins recording, it starts by taking a DOM snapshot | ||
* -- When visibility changes from "hidden" -> "visible", it must capture a full snapshot for the replay to work correctly across tabs | ||
*/ | ||
hasSnapshot = false | ||
/** Payload metadata -- Should indicate that the payload being sent has a meta node. The meta node should always precede a snapshot node. */ | ||
hasMeta = false | ||
/** Payload metadata -- Should indicate that the payload being sent contains an error. Used for query/filter purposes in UI */ | ||
hasError = false | ||
/** Payload metadata -- Denotes whether all stylesheet elements were able to be inlined */ | ||
inlinedAllStylesheets = true | ||
|
||
add (event) { | ||
this.events.push(event) | ||
this.#events.add(event) | ||
} | ||
|
||
get events () { | ||
return this.#events.buffer | ||
} | ||
|
||
/** A value which increments with every new mutation node reported. Resets after a harvest is sent */ | ||
get payloadBytesEstimation () { | ||
return this.#events.bytes | ||
} | ||
} |
Oops, something went wrong.