Added retry logic & batching settings#1
Conversation
The incorrect index error will only happen if an token is locked down to a specific index(es).
Specify the max number of retries when configuring a logger. The maximum backoff (time between retries) is capped at 2 minutes.
Also updated tests.
When this many events are in the contextQueue, flush() will be called.
splunklogger.js
Outdated
There was a problem hiding this comment.
If _enableTimer(interval) is called explicitly, we just store that interval value in the config. It could be removed
splunklogger.js
Outdated
There was a problem hiding this comment.
I also don't get this case here. Why do you distinguish between batch and unbatched?
There was a problem hiding this comment.
For isBatched we empty the entire queue, otherwise 1 event per request
There was a problem hiding this comment.
I understand what you're doing, I just don't understand why you're doing it. Why are you making a distinction here?
splunklogger.js
Outdated
There was a problem hiding this comment.
what measurement units do you use here? Milliseconds?
TODO: - Make some decisions about middleware - Update remaining examples - Add a few timer tests for 100% coverage - Added ability to have custom event formatter - Context no longer has config or requestOptions - If !autoflush and any batching settings, throw an error - Simplified logic in many places - Added several util functions - Updated tests - Clarified the basic.js example
All batch settings will be ignored when they are <= 0.
Added remaining tests for utils
We have collectively decided that this feature does not provide enough value at this time.
examples/basic.js
Outdated
There was a problem hiding this comment.
If none of the batch settings are configured, and autoFlush === true (the default) it's basically not manual batching
splunklogger.js
Outdated
There was a problem hiding this comment.
Why do you need contextQueue? This could easily be just an incremented number. You're storing a lot more memory this way.
There was a problem hiding this comment.
simplified, done
This change optimizes the flush() function since events will only be serialized once after passed to send(). Without middleware, we no longer need to store un-serialized objects.
To disable autoFlush behavior, set all batching settings to 0. It is still enabled by default - flushing events 1 by 1. Modify this behavior through the config object.
|
Closing this PR, opening another one with updated readme, examples and version numbers. |
No description provided.