mixpanel/mixpanel-iphone

What happens to events which exceeded than queue size 5000?

Athenay opened this issue · 2 comments

Integration Method: CocoaPods / Carthage / Manual
Xcode Version: 11.4
Library Version: 2.7.0
Platform: iOS
Language: Swift
Description:

Hello,
Thanks for your awesome library.
While I was reading the code I noticed something and I want to ask you about it within this issue.
Inside track function of Track class, when a new event is adding to the queue, there is an if statement which you check for queue size and make sure it does not exceed the queue size which is defined 5000.

if shadowEventsQueue.count > QueueConstants.queueSize {
shadowEventsQueue.remove(at: 0)
}

I was wondering to know what happens to the first element that will be removed if the condition meets?
Will we miss this event?

Thank you for considering my request.

hi @Athenay , the oldest event will be dropped. Given the events are being frequently flushed to Mixpanel, in vast majority of cases, the event queue won't be accumulated to a large size so 5000 is more than enough. If you find this number not meeting your need, you can tweak this manually, we will also consider expose this property in future if have more requests.

for swift issues, open issues in our swift repo is preferred, https://github.com/mixpanel/mixpanel-swift, I'm closing this one now. Thanks!