Syntax
Java
NewRelic.setMaxEventPoolSize(int $maxSize)
Kotlin [#kotlin]
NewRelic.setMaxEventPoolSize(maxSize: Int)
Description [#description]
Sets the maximum size of the event pool.
By default, collects a maximum of 1,000 events per event harvest cycle, which is 600 seconds long by default. This method controls the maximum size of the event pool stored in the memory until the next harvest cycle. When the pool size limit is reached, the New Relic Android agent will begin sampling events, discarding some old and some new events, until the pool of events are transmitted with the next harvest cycle. This method lets you override the maximum size of that event pool.
The default value for the event harvest cycle is 600 seconds. See Set max event buffer time to change the length of the event harvest cycle.
Important
Be aware that reporting a large number of events, or reporting events too frequently, may impact app performance.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. Maximum size of event pool. |
Example [#example]
Here's an example to set max size of event pool to 1000:
Java [#java]
NewRelic.setMaxEventPoolSize(1000);
Kotlin [#kotlin]
NewRelic.setMaxEventPoolSize(1000)
Syntax
Objective-C
+ (void) setMaxEventPoolSize:(unsigned int)size;
Swift [#swift]
NewRelic.setMaxEventPoolSize(unsigned int $size)
Description [#description]
Sets the maximum size of the event pool.
By default, the iOS agent collects a maximum of 1000 events per harvest cycle.
This method controls the maximum size of the event pool stored in the memory until the next harvest cycle. When the pool size limit is reached, the New Relic iOS agent will begin sampling events, discarding some old and some new events, until the pool of events are transmitted with the next harvest cycle.
This method lets you override the maximum size of that event pool. You must set this value after Agent.start()
is called.
The default value for the event harvest cycle is 600 seconds. See also Set max event buffer time to change the length of the event harvest cycle.
To ensure that the new value is always applied, place this API call in the applicationDidBecomeActive
iOS lifecycle method.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Examples [#examples]
Objective-C [#obj-c]
BOOL poolSizeSet = [NewRelic setMaxEventPoolSize:1000];
Swift [#swift]
let poolSizeSet = NewRelic.setMaxEventPoolSize(1000)
Syntax
setMaxEventPoolSize(options: { maxPoolSize: number; }) => void
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
NewRelicCapacitorPlugin.setMaxEventPoolSize({ maxPoolSize: 2000 })
Syntax
setMaxEventPoolSize(maxSize: number): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
NewRelic.setMaxEventPoolSize(2000);
Syntax
SetMaxEventPoolSize(int maxPoolSize): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
CrossNewRelic.Current.SetMaxEventPoolSize(1500);
Syntax
setMaxEventPoolSize(int maxSize): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
NewrelicMobile.instance.setMaxEventPoolSize(10000);
Syntax
setMaxEventPoolSize(maxSize: number): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
NewRelic.setMaxEventPoolSize(2000);
Syntax
SetMaxEventPoolSize(int maxPoolSize): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
NewRelicAgent.SetMaxEventPoolSize(1500);
Syntax
setMaxEventPoolSize(int64 maxSize): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
#include "NewRelicBPLibrary.h"
UNewRelicBPLibrary::setMaxEventPoolSize(2000);
Syntax
SetMaxEventPoolSize(int maxPoolSize): void;
Description [#description]
Sets the maximum size of the event pool stored in memory until the next harvest cycle. Default is a maximum of 1000 events per event harvest cycle. When the pool size limit is reached, the agent will start sampling events, discarding some new and old, until the pool of events is sent in the next harvest cycle.
Parameters [#parameters]
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum number of events that can be buffered in memory before they are sent to New Relic. |
Example [#example]
CrossNewRelicClient.Current.SetMaxEventPoolSize(1500);