-
Notifications
You must be signed in to change notification settings - Fork 60
Add maxBatchSize parameter to IntervalBatcher #59
Conversation
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.
Looks good! Thanks for the PR. Couple of review items.
internal static class EnumerableExtensions | ||
{ | ||
// from https://github.com/morelinq/MoreLINQ/blob/master/MoreLinq/Batch.cs | ||
public static IEnumerable<IEnumerable<TSource>> Batch<TSource>(this IEnumerable<TSource> source, int size) |
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.
To comply with the license of the original code, the original copyright info has to be included here. (Apache License 2.0 section 4.c.).
@@ -4,6 +4,6 @@ namespace InfluxDB.Collector.Configuration | |||
{ | |||
public abstract class CollectorBatchConfiguration | |||
{ | |||
public abstract CollectorConfiguration AtInterval(TimeSpan interval); | |||
public abstract CollectorConfiguration AtInterval(TimeSpan interval, int? maxBatchSize = null); |
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.
Should we default this to a value in line with what InfluxDB suggests? (1000 to 5000?)
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.
Can we add an overload of this method that accepts the maxBatchSize
instead, so that we can avoid bumping the major version? (Binary-incompatible change)
@nblumhardt Thx for the review. I addressed your comments. |
db0cadf
to
f458441
Compare
I've squashed the commits |
👍 thanks! |
any chance we could get a (dev) release with this feature in it? |
Thanks for the heads-up, @cypressious - looks like the build needs some attention. I'll raise an issue 👍 |
Fixes #58