setMaxEventBufferTime

setMaxEventBufferTime:(unsigned int)seconds; NewRelic.setMaxEventBufferTime:(unsigned int)seconds;
Sets the event harvest cycle length. Default is 600 seconds.

Requirements

To ensure that the new value is always applied, place this API call in the applicationDidBecomeActive iOS lifecycle method.

Compatible with all agent versions.

Description

Sets the maximum time (in seconds) that the agent will store events in memory. When the oldest event exceeds this time, the agent transmits the buffered content at the harvest cycle. You must set this value after the start call.

  • 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.

For context on how to use this API, see the documentation about sending custom attributes and events to Insights for:

Return value(s)

Returns true if recorded successfully, and false if it doesn't.

Example(s)

Objective-C

Method:

+ (void) setMaxEventBufferTime:(unsigned int)seconds;

Example:

BOOL fiveMinuteLimitSet = [NewRelic setMaxEventBufferTime:600];

Swift

Method:

NewRelic.setMaxEventBufferTime(seconds: UInt32)

Example:

let fiveMinuteLimitSet = NewRelic.setMaxEventBufferTime(600)

For more help

Recommendations for learning more: