Add indexSize and usedIndexSize to IndexStats - #946
Conversation
📝 WalkthroughWalkthrough
ChangesIndex statistics size fields
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related issues
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/Contracts/StatsTest.php (1)
28-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd direct assertions for the new getters.
The fixtures verify constructor and
fromArray()values, but no assertion callsgetIndexSize()orgetUsedIndexSize(). Add assertions for both getters.Also applies to: 55-56, 73-74
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/Contracts/StatsTest.php` around lines 28 - 29, Add direct assertions for getIndexSize() and getUsedIndexSize() in the relevant StatsTest fixture cases, including the constructor and fromArray() scenarios. Verify each getter returns the expected indexSize and usedIndexSize values alongside the existing value checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/Contracts/StatsTest.php`:
- Around line 28-29: Add direct assertions for getIndexSize() and
getUsedIndexSize() in the relevant StatsTest fixture cases, including the
constructor and fromArray() scenarios. Verify each getter returns the expected
indexSize and usedIndexSize values alongside the existing value checks.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 76106ab2-cb4b-4223-88c6-e119ed196339
📒 Files selected for processing (2)
src/Contracts/IndexStats.phptests/Contracts/StatsTest.php
Adds the indexSize and usedIndexSize fields to IndexStats, following the existing pattern (constructor param, getter, fromArray, phpstan type). Refs meilisearch#943
84b3bc9 to
a7bd28c
Compare
Summary
This adds
indexSizeandusedIndexSizetoIndexStats. I just followed the same pattern already used by the other fields (constructor param, getter,fromArray, PHPStan type), so it should feel consistent with the rest of the class.Related issue
Refs #943
What does this PR do?
indexSizeandusedIndexSizeto theRawIndexStatsPHPStan type insrc/Contracts/IndexStats.phpgetIndexSize()/getUsedIndexSize()gettersIndexStats::fromArray()tests/Contracts/StatsTest.php(testConstructandtestFromArray) to cover the new fieldsPR checklist
Thanks for taking a look!