RockteMQ-AI commented on PR #4340:
URL: 
https://github.com/apache/rocketmq-dashboard/pull/4340#issuecomment-5682168790

   ## 🤖 Automated Code Review
   
   **PR:** [ISSUE #4337] Add Broker Cold Data Read Ratio & Page Cache Hit Rate 
Inspector
   **Verdict: ❌ Critical Issues — Not Ready for Merge**
   
   ### 🔴 Critical: Service Returns Fabricated Metrics
   
   The service implementation generates fake metrics using hash-based random 
values instead of querying actual broker runtime statistics:
   
   ```java
   // BrokerColdReadInspectorServiceImpl.java
   double totalRead = 1200.0 + (Math.abs(bName.hashCode()) % 1500);
   double coldTps = 25.0 + (Math.abs(bName.hashCode()) % 120);
   ```
   
   The code explicitly acknowledges this with a fallback log message:
   ```java
   log.warn("Failed to collect broker cluster metrics for cold read inspection, 
fallback to mock stats", e);
   ```
   
   However, the "mock stats" path is the **primary** code path — the real 
metrics collection is never implemented. This means the inspector always shows 
fabricated data, not real page cache hit rates or cold read ratios.
   
   ### 🔴 Critical: Misleading Dashboard Display
   
   The frontend displays these fabricated values as if they were real broker 
metrics. Operators relying on this data for capacity planning or performance 
tuning would be making decisions based on completely fictional numbers.
   
   ### ⚠️ Other Issues
   - **No integration with `BrokerStatsManager`** or `MQAdminExt` for real 
metrics
   - **No time-series data** — real monitoring needs historical trends
   - **No alerting thresholds** based on actual SLA requirements
   - **No tests** for metric collection logic
   
   ### Recommendation
   This PR needs:
   1. Real metrics collection via `BrokerStatsManager` or JMX
   2. Actual page cache hit rate calculation from OS-level stats
   3. Proper error handling when brokers are unreachable
   4. Historical data storage for trend analysis
   
   ---
   <sub>🔍 Automated review by RockteMQ-AI. Please verify suggestions before 
applying.</sub>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to