Document TotalCompactions() running-counter semantics - #17
Open
devthedeveloper wants to merge 1 commit into
Open
Document TotalCompactions() running-counter semantics#17devthedeveloper wants to merge 1 commit into
devthedeveloper wants to merge 1 commit into
Conversation
ContextState.Compactions is a cumulative counter (compactions so far in the loop), so max across iterations is the correct total. Document this on the metric, the field, and the LTF wire format, and add a test that locks the max-not-sum behavior.
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 #12
ContextState.Compactionsis a cumulative running counter, not a per-iteration count — the demo trace generator writes it as 0 → 1 → 4 across iterations. Given that,TotalCompactions()taking the max across iterations is correct: the max of a running counter is the total. Renaming toMaxCompactions()would be misleading, so this PR takes the issue's other option and documents the semantics instead.TotalCompactions()explaining why max (not sum, not last iteration) is usedContextState.Compactionsfield and the matching LTF wire-format field in the parser0,1,4→ total4, so a future "fix" to sum (which would give 5) fails CI