SWJTU-ZhangLei commented on code in PR #54694:
URL: https://github.com/apache/doris/pull/54694#discussion_r2334073567


##########
be/src/olap/compaction.cpp:
##########
@@ -1660,5 +1661,37 @@ int64_t CloudCompactionMixin::num_input_rowsets() const {
     return count;
 }
 
+bool CloudCompactionMixin::should_cache_compaction_output() {
+    if (compaction_type() == ReaderType::READER_CUMULATIVE_COMPACTION) {
+        return true;
+    }
+
+    if (compaction_type() == ReaderType::READER_BASE_COMPACTION) {
+        double input_rowsets_hit_cache_ratio = 0.0;
+        if (cloud_tablet()->input_rowsets_total_data_size() > 0) {
+            input_rowsets_hit_cache_ratio =
+                    double(cloud_tablet()->input_rowsets_total_cached_size()) /
+                    double(cloud_tablet()->input_rowsets_total_data_size());
+        }
+        
base_compaction_input_rowsets_data_hit_cache_ratio.set_value(input_rowsets_hit_cache_ratio);

Review Comment:
   > bvar 统计单次的命中率没有意义. 需要基于时间窗口的统计值.
   
   done



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to