The New Relic documentation says that it supports up to 2000 events in one request, but only 100 000 requests per minute for the account.
Reporting is slowed down so it could happen that in case of a lot of events we could start losing data, as the queue size is set to 500 events. Also during crashes, we can lose data that was qued up but didn't have time to be sent.
Maybe you can test something like this:
function nrEventProcessor() as Void
if m.nr <> invalid
events = m.nr.callFunc("nrExtractAllEvents")
res = nrInsertInsightsData(events)
if res <> 200
m.nr.callFunc("nrLog", "-- nrEventProcessor: FAILED, retry later --")
m.nr.callFunc("nrGetBackEvents", events)
end if
end if
end function
Or maybe at least send events in packs of 10 or 50 if sending big POST requests causing some issues.
nrEventProcessor function in NRTask in sending one request with one event after another. This creates a bottleneck in the reporting. https://github.com/newrelic/video-agent-roku/blob/9aa887ce187cb51c8a8e40cb98bf1823b7c551e6/components/NewRelicAgent/NRTask.brs#L35-L50 Is there a reason why this is not sending the whole events array at once?
I have two big concerns:
Maybe you can test something like this:
Or maybe at least send events in packs of 10 or 50 if sending big POST requests causing some issues.