Caching of NewRelic.recordBreadcrumb() and NewRelic.recordCustomEvent()

Hi All.

General question here. maybe a bit of a dim one but I cant see any docs for it when I looked.

Do these calls cache at all? and if they do, is there a way to force sending?


I am investigating some differences we are seeing between NewRelic and another couple of Analytics systems we use showing different data for key events.

in app a user buys something, and we are thinking that they are then very quickly closing the app as they have finished there business.

My hunch is that 1 of these systems is sending the event instantly as it has slightly higher numbers of events per day., NewRelic has some caching / polling system which is not sending if the user closes the app ( highly possible after the purchase event in app ) and our 3rd system caches till the next app launch resulting in different figures.

So, is there a way to force everything to send that is in any cache NewRelic has? something I can call when the app is hibernated or should I be looking at NewRelic.setMaxEventBufferTime(); to reduce timers? if the latter what is the default time for NewRelic.setMaxEventBufferTime();?



Data collected by the mobile agents is stored locally on the user’s device in the agent’s data event pool. The harvest occurs on a timer OR when the app is backgrounded. If a user backgrounds the app, the agent shuts down, and sends any events in the event pool to New Relic.

If the app is force closed, this data may get dropped due to the agent not being able to properly shut down.

If the app crashes, the Android agent attempts to send everything, including crash data, immediately. The iOS agent stores the data and sends it on the next app launch.

Unless users are force closing the app, we expect that data will be sent when the app is sent to background.

Reducing the harvest timer will make the agent send data more frequently (default is 600 seconds for events, 60 seconds for metrics).

If it seems that expected events are not reporting, the agent may have hit the event pool limit within the timed harvest window and begun sampling. In this case, you could increase the event pool, or decrease the harvest timer.

Another option to send custom events, is to use the Event API:

1 Like

Excellent thanks for the information. Much appreciated. I think we’ll have to go for the API for our key events to make sure they get sent asap but everything else can just go through the standard events.

I think we’re loosing 5/10% of tracking on some key events as its the “end of business” for the user in app so are closing instantly.

1 Like

Glad to hear you found that helpful @kthompson, let us know if you need anything further :slightly_smiling_face: