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/10/13 02:13:39 UTC

[GitHub] [incubator-pegasus] Smityz commented on a change in pull request #615: feat(hotkey): add an interface of hotkey capture

Smityz commented on a change in pull request #615:
URL: https://github.com/apache/incubator-pegasus/pull/615#discussion_r503627225



##########
File path: src/server/capacity_unit_calculator.cpp
##########
@@ -144,25 +161,28 @@ void capacity_unit_calculator::add_scan_cu(int32_t status,
     int64_t data_size = 0;
     for (const auto &kv : kvs) {
         data_size += kv.key.size() + kv.value.size();
+        _read_hotkey_collector->capture_raw_key(kv.key, 1);
     }
     add_read_cu(data_size);
     _pfc_scan_bytes->add(data_size);
 }
 
-void capacity_unit_calculator::add_sortkey_count_cu(int32_t status)
+void capacity_unit_calculator::add_sortkey_count_cu(int32_t status, const dsn::blob &hash_key)
 {
     if (status != rocksdb::Status::kOk && status != rocksdb::Status::kNotFound) {
         return;
     }
     add_read_cu(1);
+    _read_hotkey_collector->capture_hash_key(hash_key, 1);
 }
 
-void capacity_unit_calculator::add_ttl_cu(int32_t status)
+void capacity_unit_calculator::add_ttl_cu(int32_t status, const dsn::blob &key)
 {
     if (status != rocksdb::Status::kOk && status != rocksdb::Status::kNotFound) {
         return;
     }
     add_read_cu(1);
+    _read_hotkey_collector->capture_raw_key(key, 1);

Review comment:
       `add_read_cu(1);` and `_read_hotkey_collector->capture_raw_key(key, 1);` have different semantics, they are not suitable for merging
   @zhangyifan27 
   
   




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