mixpanel-ruby icon indicating copy to clipboard operation
mixpanel-ruby copied to clipboard

BufferedConsumer importing more than 1 event per request

Open luisantonioa opened this issue 9 years ago • 1 comments

Is there a special reason why there are buffers in the BufferedConsume for event and profile_update messages but not for import events?

I'm currently importing around about 150k email events a day into mixpanel and since we have to use the import endpoint, as sometimes we dont have access to this data until after 5 days, it super slow to send each event as a network request.

I had a look at the code and am unsure as to why the import event was specifically excluded.

Looking at the full documentation: https://mixpanel.com/docs/api-documentation/importing-events-older-than-5-days

It seems like the import endpoint should be able to handle 50 messages fine like the others.

luisantonioa avatar Jan 13 '16 21:01 luisantonioa

I'm also looking for a way to do batch imports. I found this comment on the PR that originally added the import feature:

I think it's possible that we may have multiple messages with different API keys here (some customers use multiple projects) - I'm going to eliminate buffering for imports for now (so BufferedConsumer will just send imports immediately, and buffer :event and :profile_updates). We imagine most folks use import in batch processes, so this should still be ok (and of course, there is nothing to prevent customers from implementing their own batch scheme for imports.)

stevehanson avatar Feb 07 '18 23:02 stevehanson