Skip to content

Commit 723eac5

Browse files
authored
Merge pull request #5808 from segmentio/update-node-flushAt
change maxEventsInBatch -> flushAt
2 parents c17f2f7 + 4d13401 commit 723eac5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/connections/sources/catalog/libraries/server/node/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ const analytics = new Analytics({
269269
host: 'https://api.segment.io',
270270
path: '/v1/batch',
271271
maxRetries: 3,
272-
maxEventsInBatch: 15,
272+
flushAt: 15,
273273
flushInterval: 10000,
274274
// ... and more!
275275
})
@@ -281,7 +281,7 @@ Setting | Details
281281
`host` _string_ | The base URL of the API. The default is: "https://api.segment.io"
282282
`path` _string_ | The API path route. The default is: "/v1/batch"
283283
`maxRetries` _number_ | The number of times to retry flushing a batch. The default is: `3`
284-
`maxEventsInBatch` _number_ | The number of messages to enqueue before flushing. The default is: `15`
284+
`flushAt` _number_ | The number of messages to enqueue before flushing. The default is: `15`
285285
`flushInterval` _number_ | The number of milliseconds to wait before flushing the queue automatically. The default is: `10000`
286286
`httpRequestTimeout` _number_ | The maximum number of milliseconds to wait for an http request. The default is: `10000`
287287
`disable` _boolean_ | Disable the analytics library for testing. The default is: `false`
@@ -534,17 +534,17 @@ Every method you call **doesn't** result in a HTTP request, but is queued in mem
534534
535535
By default, Segment's library will flush:
536536
537-
- Every 15 messages (controlled by `settings.maxEventsInBatch`).
537+
- Every 15 messages (controlled by `settings.flushAt`).
538538
- If 10 seconds has passed since the last flush (controlled by `settings.flushInterval`)
539539
540540
There is a maximum of `500KB` per batch request and `32KB` per call.
541541
542-
If you don't want to batch messages, you can turn batching off by setting the `maxEventsInBatch` setting to `1`, like so:
542+
If you don't want to batch messages, you can turn batching off by setting the `flushAt` setting to `1`, like so:
543543
544544
```javascript
545545
const analytics = new Analytics({
546546
...
547-
maxEventsInBatch: 1
547+
flushAt: 1
548548
});
549549
```
550550

src/connections/sources/catalog/libraries/server/node/migration.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ If you're using the [classic version of Analytics Node.js](/docs/connections/sou
5555
```javascript
5656
(err, ctx) => void
5757
```
58-
* The `flushAt` configuration option changed to `maxEventsInBatch`.
5958

6059
* The `enable` setting (for disabling analytics during tests) changed to `disable`. `enable: false` changed to `disable: true`.
6160

0 commit comments

Comments
 (0)