levy5307 commented on a change in pull request #631: URL: https://github.com/apache/incubator-pegasus/pull/631#discussion_r517088832
########## File path: src/server/hotkey_collector.cpp ########## @@ -251,5 +260,78 @@ void hotkey_coarse_data_collector::analyse_data(detect_hotkey_result &result) } } +hotkey_fine_data_collector::hotkey_fine_data_collector(replica_base *base, + int target_bucket_index, + int max_queue_size) + : internal_collector_base(base), + _max_queue_size(max_queue_size), + _target_bucket_index(target_bucket_index), + _capture_key_queue(max_queue_size) +{ +} + +void hotkey_fine_data_collector::capture_data(const dsn::blob &hash_key, uint64_t weight) +{ + if (get_bucket_id(hash_key) != _target_bucket_index) { + return; + } + _capture_key_queue.try_enqueue(std::make_pair(hash_key, weight)); +} + +struct blob_hash +{ + std::size_t operator()(const dsn::blob &str) const + { + dsn::string_view cp(str); + return boost::hash_range(cp.begin(), cp.end()); + } +}; Review comment: add a blank line ---------------------------------------------------------------- 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: dev-unsubscr...@pegasus.apache.org For additional commands, e-mail: dev-h...@pegasus.apache.org