Syntax
Java
NewRelic.setMaxEventBufferTime(int $maxBufferTimeInSec)
Kotlin
NewRelic.setMaxEventBufferTime(maxBufferTimeInSec: Int)
Description
Sets the event harvest cycle length.
This method sets the maximum time in seconds that the New Relic Android agent will store events in memory before including the buffered event to be sent to New Relic in the next harvest cycle.
Default is 600 seconds (10 minutes).
Minimum value cannot be less than 60 seconds.
Maximum value should not be greater than 600 seconds.
In other words, when the oldest event timestamp exceeds this custom configured time, the agent transmits the buffered content at the harvest cycle between each connection from a New Relic agent to the collector.
See also
setMaxEventPoolSize()
, which sets the maximum number of events that are stored by the agent during a harvest cycle.Important
Be aware that reporting a large number of events, or reporting events too frequently, may impact app performance.
Parameters
Parameter
Type
Description
$maxBufferTimeInSec
int
Required. The maximum time (in seconds) that the agent should store events in memory. The default value harvest cycle length is 600 seconds.
Example
Here's an example to set max event buffer time to 300 seconds:
Java
boolean NewRelic.setMaxEventBufferTime(300);
Kotlin
NewRelic.setMaxEventBufferTime(300)
Syntax
Objective-c
+ (void) setMaxEventBufferTime:(unsigned int)seconds;
Swift
NewRelic.setMaxEventBufferTime:(unsigned int)seconds;
Description
Sets the event harvest cycle length. Default is 600 seconds.
This method sets the maximum time in seconds that the New Relic iOS agent will store events in memory before including the buffered event to be sent to New Relic in the next harvest cycle.
In other words, when the oldest event timestamp exceeds this custom configured time, the agent transmits the buffered content at the harvest cycle between each connection from a New Relic agent to the collector. You must set this value after Agent.start()
is called.
Default is 600 seconds (10 minutes).
Minimum value cannot be less than 60 seconds.
See also
setMaxEventPoolSize()
, which lets you change the maximum size of the event pool.Parameters
Parameter
Type
Description
seconds
unsigned int
Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.
Examples
Objective-C
BOOL fiveMinuteLimitSet = [NewRelic setMaxEventBufferTime:600];
Swift
let fiveMinuteLimitSet = NewRelic.setMaxEventBufferTime(600)
Syntax
setMaxEventBufferTime(options: { maxBufferTimeInSeconds: number; }) => void
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. An object that contains the maximum buffer time in seconds. |
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
NewRelicCapacitorPlugin.setMaxEventBufferTime({ maxBufferTimeInSeconds: 60 });
Syntax
setMaxEventBufferTime(maxBufferTimeInSeconds: number): void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
NewRelic.setMaxEventBufferTime(60);
Syntax
SetMaxEventBufferTime(int maxBufferTimeInSec) void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
CrossNewRelic.Current.SetMaxEventBufferTime(200);
Syntax
setMaxEventBufferTime(int maxBufferTimeInSec) void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
NewrelicMobile.instance.setMaxEventBufferTime(200);
Syntax
setMaxEventBufferTime(maxBufferTimeInSeconds: number): void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
NewRelic.setMaxEventBufferTime(60);
Syntax
SetMaxEventBufferTime(int maxBufferTimeInSec) void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
NewRelicAgent.SetMaxEventBufferTime(200);
Syntax
setMaxEventBufferTime(int64 maxBufferTimeInSec):void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
UNewRelicBPLibrary::setMaxEventBufferTime(60);
Syntax
SetMaxEventBufferTime(int maxBufferTimeInSec) void;
Description
Sets the event harvest cycle length. Default is 600 seconds (10 minutes). Minimum value can not be less than 60 seconds. Maximum value should not be greater than 600 seconds.
Parameters
Parameter | Type | Description |
---|---|---|
|
| Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic. |
Example
CrossNewRelicClient.Current.SetMaxEventBufferTime(200);