• /
  • Log in
  • Free account

setMaxEventBufferTime (iOS SDK API)

Syntax

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

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.

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

Return values

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

Examples

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)
Create issueEdit page
Copyright © 2022 New Relic Inc.