weizuo93 commented on a change in pull request #4837:
URL: https://github.com/apache/incubator-doris/pull/4837#discussion_r519575666



##########
File path: be/src/olap/tablet.cpp
##########
@@ -1309,4 +1311,16 @@ void 
Tablet::generate_tablet_meta_copy_unlocked(TabletMetaSharedPtr new_tablet_m
     new_tablet_meta->init_from_pb(tablet_meta_pb);
 }
 
+double Tablet::calculate_scan_frequency() {
+    time_t now = time(nullptr);
+    int64_t current_count = query_scan_count->value();
+    double interval = difftime(now, _last_record_scan_count_timestamp);
+    double scan_frequency = (current_count - _last_record_scan_count) * 60 / 
interval;

Review comment:
       > Why multi 60?
   
   It means the average count of tablet scans for each minute, Otherwise it 
will be the average count of tablet scans for each second .




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to