Lua script optimization & Configure Logrotate#18
Open
astarinmymind wants to merge 3 commits intonoluarotatefrom
Open
Lua script optimization & Configure Logrotate#18astarinmymind wants to merge 3 commits intonoluarotatefrom
astarinmymind wants to merge 3 commits intonoluarotatefrom
Conversation
bakhtin
reviewed
Feb 4, 2025
| local bucket_logs = buckets[earliest_sec] | ||
| if bucket_logs then | ||
| -- Move all logs in this bucket to 'to_emit' | ||
| for _, old_record in ipairs(bucket_logs) do |
There was a problem hiding this comment.
Copying records one by one into a new table sounds like a lot of overhead. Esp. on large volumes.
Not sure how to properly do it in Lua but I suggest instead of copying each record one by one, consider storing only indices of the buckets that you want to emit, concatenate the tables, and emit them all together later in the code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lua script:
{1: [log_record1, log_record2], 2: [log_record3, log_record4]}Logrotate:
Pins fluent-bit version to amd64-specific digest (not the multi-arch!)