You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2020/09/18 04:03:44 UTC

[GitHub] [incubator-pegasus] levy5307 commented on a change in pull request #604: feat(hotspot): calculator auto detect hotkey in the hot partition

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org