Skip to content

Commit 39ba7da

Browse files
authored
feat: increase default eventCacheSize to 1000 (#728)
1 parent 5fd50aa commit 39ba7da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ For example, the config object may look similar to the following:
4444
| telemetries | [Telemetry Config Array](#telemetry-config-array) | `[]` | See [Telemetry Config Array](#telemetry-config-array) |
4545
| batchLimit | Number | `100` | The maximum number of events that will be sent in one batch of RUM events. |
4646
| dispatchInterval | Number | `5000` | The frequency (in milliseconds) in which the webclient will dispatch a batch of RUM events. RUM events are first cached and then automatically dispatched at this set interval. |
47-
| eventCacheSize | Number | `500` | The maximum number of events the cache can contain before dropping events. |
47+
| eventCacheSize | Number | `1000` | The maximum number of events the cache can contain before dropping events. Each event is typically 1KB in size, so we recommend a default limit of 1000 events -> 1 MB to balance performance against capturing all observed events. If necessary, feel free to enable debug mode to get detailed logs on how to optimize cache size depending on your application behavior. |
4848
| sessionLengthSeconds | Number | `1800` | The duration of a session (in seconds). |
4949
| headers | Object | `{}` | The **headers** configuration is optional and allows you to include custom headers in an HTTP request. For example, you can use it to pass `Authorization` and `x-api-key` headers.<br/><br/>For more details, see: [MDN - Request Headers](https://developer.mozilla.org/en-US/docs/Glossary/Request_header). |
5050

src/orchestration/Orchestration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export const defaultConfig = (cookieAttributes: CookieAttributes): Config => {
8080
enableXRay: false,
8181
endpoint: DEFAULT_ENDPOINT,
8282
endpointUrl: new URL(DEFAULT_ENDPOINT),
83-
eventCacheSize: 200,
83+
eventCacheSize: 1000,
8484
eventPluginsToLoad: [],
8585
pageIdFormat: PageIdFormatEnum.Path,
8686
pagesToExclude: [],

src/orchestration/__tests__/Orchestration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ describe('defaultConfig tests', () => {
553553
expect(config.endpointUrl).toEqual(
554554
new URL('https://dataplane.rum.us-west-2.amazonaws.com')
555555
);
556-
expect(config.eventCacheSize).toBe(200);
556+
expect(config.eventCacheSize).toBe(1000);
557557
expect(config.eventPluginsToLoad).toEqual([]);
558558
expect(config.pageIdFormat).toBe('PATH');
559559
expect(config.pagesToExclude).toEqual([]);

0 commit comments

Comments
 (0)