• EnglishEspañol日本語한국어Português
  • Log inStart now

Set max event buffer time

Syntax

Java

NewRelic.setMaxEventBufferTime(int $maxBufferTimeInSec)

Kotlin [#kotlin]

NewRelic.setMaxEventBufferTime(maxBufferTimeInSec: Int)

Description [#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 [#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 [#example]

Here's an example to set max event buffer time to 300 seconds:

Java [#java]

boolean NewRelic.setMaxEventBufferTime(300);

Kotlin [#kotlin]

NewRelic.setMaxEventBufferTime(300)

Syntax

Objective-c

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

Swift [#swift]

NewRelic.setMaxEventBufferTime:(unsigned int)seconds;

Description [#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 [#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 [#examples]

Objective-C [#obj-c]

BOOL fiveMinuteLimitSet = [NewRelic setMaxEventBufferTime:600];

Swift [#swift]

let fiveMinuteLimitSet = NewRelic.setMaxEventBufferTime(600)

Syntax

setMaxEventBufferTime(options: { maxBufferTimeInSeconds: number; }) => void

Description [#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 [#parameters]

Parameter

Type

Description

options

{ maxBufferTimeInSeconds: number; }

Required. An object that contains the maximum buffer time in seconds.

maxBufferTimeInSeconds

number

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

NewRelicCapacitorPlugin.setMaxEventBufferTime({ maxBufferTimeInSeconds: 60 });

Syntax

setMaxEventBufferTime(maxBufferTimeInSeconds: number): void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSeconds

number

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

NewRelic.setMaxEventBufferTime(60);

Syntax

SetMaxEventBufferTime(int maxBufferTimeInSec) void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSec

int

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

CrossNewRelic.Current.SetMaxEventBufferTime(200);

Syntax

setMaxEventBufferTime(int maxBufferTimeInSec) void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSec

int

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

NewrelicMobile.instance.setMaxEventBufferTime(200);

Syntax

setMaxEventBufferTime(maxBufferTimeInSeconds: number): void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSeconds

number

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

NewRelic.setMaxEventBufferTime(60);

Syntax

SetMaxEventBufferTime(int maxBufferTimeInSec) void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSec

int

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

NewRelicAgent.SetMaxEventBufferTime(200);

Syntax

setMaxEventBufferTime(int64 maxBufferTimeInSec):void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSec

int

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

UNewRelicBPLibrary::setMaxEventBufferTime(60);

Syntax

SetMaxEventBufferTime(int maxBufferTimeInSec) void;

Description [#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 [#parameters]

Parameter

Type

Description

maxBufferTimeInSec

int

Required. The maximum amount of time in seconds that events can be buffered before they are sent to New Relic.

Example [#example]

CrossNewRelicClient.Current.SetMaxEventBufferTime(200);
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.