Fix getOpenFileDescriptors() to use _Total PDH counter instance#3158
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2026-04-03T02:07:47.621ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughReplaced per-instance PDH enumeration in Changes
Sequence Diagram(s)(Skipped) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3158 +/- ##
==========================================
+ Coverage 57.84% 58.06% +0.21%
==========================================
Files 324 324
Lines 17394 17375 -19
Branches 3069 3066 -3
==========================================
+ Hits 10062 10088 +26
+ Misses 5857 5804 -53
- Partials 1475 1483 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is still failing the JNA == FFM test because the actual counter is |
PdhGetFormattedCounterArray does not work with a specific instance counter path like \\Process(_Total)\\Handle Count. Use PdhGetFormattedCounterValue instead, which is the correct API for single-instance counters.
bba7d72 to
cd350b3
Compare
The FFM merge was preserving the local volume name from GetVolumeInformation (e.g. "Windows (C:\\\)") instead of using the WMI description (e.g. "Local Fixed Disk (C:)") like JNA does.
Fix PdhUtilFFM.getOpenFileDescriptors() to query the pre-aggregated _Total PDH counter instance instead of wildcard.
Aligns FFM implementation with the working JNA version for better efficiency.
Removes loop iteration and directly returns the single handle count value.
Summary by CodeRabbit
Refactor
Fix
Chore