Repository navigation
fix(gh-17): cap collector entries, enforce max profile size, prune in chunks - #26
Merged
Merged
Conversation
… chunks - Each collector keeps at most limits.max_entries entries and long strings are shortened; totals and N+1 detection still use the full data. - enforceMaxSize() re-checks the size and empties the largest sections until the profile fits, recording them in _dropped. - Pruning runs on a configurable lottery and deletes in chunks of 500. Closes #17
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Closes #17
What
limits.max_entries(default 500) per section andlimits.max_string_length(default 10000) for SQL, log context and similar.query_count, query time and N+1 detection are computed before the cap, so they still count everything. Dropped counts go to_dropped.enforceMaxSize()shortens bodies, drops bindings, then empties the largest sections until the JSON fits inmax_profile_size_kb._truncatedis set only when something was cut.prune_lottery(default 1 in 10 writes;[0, 1]turns it off for scheduler-only pruning) and deletes in chunks of 500, so large backlogs stay under SQLite's bound-parameter limit.Checks
composer test: 95 passed.