fix(aws): aggregate RI coverage across time buckets - #167
Merged
Merged
Conversation
Sum running-hour averages across every page within each coverage scope and weight percentages by those hours before enriching recommendations. Verify unequal and reversed buckets through the real SDK on loopback, including recommendation sizing, RDS separation, and late-page errors. Refs #51
Contributor
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 50 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configurationConfiguration used: Repository: LeanerCloud/cloud-commitments-go/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (2)
Comment |
This was referenced Sep 30, 2026
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.
RI coverage previously retained only the last Cost Explorer time bucket while dividing its hours by the entire lookback window. A 40-instance pool split into 28-day and 2-day buckets became 2.67 instances/hour, and recommendation enrichment propagated that undercount.
Aggregate all buckets and pages within each service/engine/region fetch, then weight coverage percentages by running hours. Preserve RDS deployment separation and percentage-only fallback behavior. Refs #51; the appended Savings Plans contract finding is handled separately, so this PR does not close the issue.
Verification: real AWS SDK against a loopback HTTP fixture, including public recommendation enrichment, unequal/reversed buckets, RDS pool separation, repeated regions, missing-hour groups and late-page failures. The original production code fails the regression; the fix reports 40 instances/hour and 71.6667% weighted coverage. Recommendations and ladder race suites, AWS build/vet, pinned lint2.10.1 and normal pre-commit checks passed. No live AWS calls or purchases.
Independent gpt-6-astra review approved exact commit
7ce5060d50c59376d756f0c4aeafacbf9d01c7fd: full diff reread and matching clean checkout, fresh focused recommendations/ladder race tests, and public SDK consumer result of 40 instances/hour at 71.6667% coverage. The reviewer independently reproduced the original failure before verifying the fix. This is the user-authorized independent review path; CodeRabbit is optional.