-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a new property 'flushBatchSize' for fine tuning the network request #617
Conversation
Sources/MixpanelInstance.swift
Outdated
@@ -119,6 +119,19 @@ open class MixpanelInstance: CustomDebugStringConvertible, FlushDelegate, AEDele | |||
} | |||
} | |||
|
|||
/// The flushBatchSize property controls the number of events sent in a single network request to the Mixpanel server. | |||
/// Batch size affects how data is flushed from the client to Mixpanel. By configuring the size of the batch, you can | |||
/// optimize network usage and control how frequently the client communicates with the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/track
has a maximum batch size of 50: https://developer.mixpanel.com/reference/track-event#limits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but we should enforce the max batch size of 50 for the /track
endpoint
@jaredmixpanel Sorry to necro a merged MR, but am I reading this correctly? It appears to me that a call to I guess it makes sense that a "full" flush will send everything, but I don't think anyone would want that if it resulted in lost events. |
Hi @RamblinWreck77, if you set the batch size to more than 50, it won't drop events but just fall back to 50. perhaps we should make it clearer in the doc. |
Add the following property
flushBatchSize
:The flushBatchSize property controls the number of events sent in a single network request to the Mixpanel server.
Batch size affects how data is flushed from the client to Mixpanel. By configuring the size of the batch, you can
optimize network usage and control how frequently the client communicates with the server.
Usage:
mixpanel.flushBatchSize = 20