Skip to content
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 messages batch size and interval options #377

Merged
merged 15 commits into from
Dec 3, 2024

Conversation

jr0me
Copy link
Member

@jr0me jr0me commented Dec 2, 2024

Related issue
#306

Description

This PR implements configurable batching for the Wazuh Agent to improve flexibility in how it sends messages to the server. Previously, the agent sent batches of messages every second without considering the batch size or the time elapsed. With this change, the batching process is governed by two configurable conditions:

A batch is sent if the specified batch_interval has elapsed and the queue contains messages.
A batch is sent if the queue accumulates batch_size messages before batch_interval elapses.
These conditions ensure:

Tests

  • Compilation without warnings in every supported platform
    • Linux
    • Windows
    • MAC OS X

@jr0me jr0me linked an issue Dec 2, 2024 that may be closed by this pull request
@jr0me jr0me changed the title Add batching size and interval options Add messages batch size and interval options Dec 2, 2024
@jr0me jr0me force-pushed the enhancement/306-batching-options branch 3 times, most recently from 2d52235 to 8ac4d24 Compare December 2, 2024 22:45
@jr0me jr0me force-pushed the enhancement/306-batching-options branch 2 times, most recently from 558e797 to e1013b0 Compare December 2, 2024 22:48
@jr0me jr0me force-pushed the enhancement/306-batching-options branch 3 times, most recently from 9cdfd58 to f7b34fd Compare December 3, 2024 00:24
@jr0me jr0me marked this pull request as ready for review December 3, 2024 00:25
@jr0me jr0me force-pushed the enhancement/306-batching-options branch from f7b34fd to 7fc6789 Compare December 3, 2024 00:28
get messages callback will now take an int parameter for the batch size
@jr0me jr0me force-pushed the enhancement/306-batching-options branch from 7fc6789 to 410da58 Compare December 3, 2024 00:29
@TomasTurina TomasTurina merged commit d14b6bc into master Dec 3, 2024
5 checks passed
@TomasTurina TomasTurina deleted the enhancement/306-batching-options branch December 3, 2024 02:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Event Batching Configurable
2 participants