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/11/17 05:41:56 UTC

[GitHub] [incubator-pegasus] neverchanje commented on a change in pull request #639: feat(hotkey): add unit test of internal_collector

neverchanje commented on a change in pull request #639:
URL: https://github.com/apache/incubator-pegasus/pull/639#discussion_r522576643



##########
File path: src/server/hotkey_collector.cpp
##########
@@ -66,8 +64,7 @@ DSN_DEFINE_int32(
     "the max time (in seconds) allowed to capture hotkey, will stop if hotkey's not found");
 
 // 68–95–99.7 rule, same algorithm as hotspot_partition_calculator::stat_histories_analyse
-static bool
-find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, int &hot_index)
+bool find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, int &hot_index)

Review comment:
       ```suggestion
   /*extern*/bool find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, int &hot_index)
   ```

##########
File path: src/server/hotkey_collector.cpp
##########
@@ -102,7 +99,7 @@ find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, in
 }
 
 // TODO: (Tangyanzhao) replace it to xxhash
-static int get_bucket_id(dsn::string_view data)
+int get_bucket_id(dsn::string_view data)

Review comment:
       ```suggestion
   /*extern*/int get_bucket_id(dsn::string_view data)
   ```

##########
File path: src/server/hotkey_collector.h
##########
@@ -33,6 +36,10 @@ struct detect_hotkey_result
     std::string hot_hash_key;
 };
 
+DSN_DECLARE_uint32(hotkey_buckets_num);
+int get_bucket_id(dsn::string_view data);
+bool find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, int &hot_index);

Review comment:
       ```suggestion
   extern int get_bucket_id(dsn::string_view data);
   extern bool find_outlier_index(const std::vector<uint64_t> &captured_keys, int threshold, int &hot_index);
   ```




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