levy5307 commented on a change in pull request #604:
URL: https://github.com/apache/incubator-pegasus/pull/604#discussion_r490689464



##########
File path: src/server/hotspot_partition_calculator.cpp
##########
@@ -128,6 +147,36 @@ void hotspot_partition_calculator::data_analyse()
         stat_histories_analyse(data_type, hot_points);
         update_hot_point(data_type, hot_points);
     }
+    if (!FLAGS_enable_hotkey_auto_detect) {
+        return;
+    }
+    for (int data_type = 0; data_type <= 1; data_type++) {
+        detect_hotkey_in_hotpartition(data_type);
+    }
+}
+
+void hotspot_partition_calculator::detect_hotkey_in_hotpartition(int data_type)
+{
+    for (int index = 0; index < _hot_points.size(); index++) {
+        if (_hot_points[index][data_type].get()->get_value() >= 
FLAGS_hot_partition_threshold) {
+            if (++_hotpartition_pool[index][data_type] >= 
FLAGS_occurrence_threshold) {
+                derror_f("Find a {} hot partition {}.{}",
+                         (data_type == partition_qps_type::READ_HOTSPOT_DATA ? 
"read" : "write"),
+                         _app_name,
+                         index);
+                FAIL_POINT_INJECT_F("send_hotkey_detect_request", 
[](dsn::string_view) {});

Review comment:
       you can move this fail point into func `send_hotkey_detect_request`




----------------------------------------------------------------
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:
[email protected]



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

Reply via email to