From 205a2c72cd279e893ac322cb8a4868ef94946720 Mon Sep 17 00:00:00 2001 From: olivertang Date: Wed, 9 Feb 2022 13:50:28 +0800 Subject: [PATCH] change a little --- src/server/capacity_unit_calculator.cpp | 2 +- src/server/pegasus_server_impl.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/capacity_unit_calculator.cpp b/src/server/capacity_unit_calculator.cpp index 0ca723fcbb..080bc5bd6b 100644 --- a/src/server/capacity_unit_calculator.cpp +++ b/src/server/capacity_unit_calculator.cpp @@ -185,7 +185,7 @@ void capacity_unit_calculator::add_batch_get_cu(dsn::message_ex *req, { int64_t data_size = 0; for (const auto &data : datas) { - data_size += data.value.size(); + data_size += data.hash_key.size() + data.sort_key.size() + data.value.size(); _read_hotkey_collector->capture_hash_key(data.hash_key, 1); } diff --git a/src/server/pegasus_server_impl.cpp b/src/server/pegasus_server_impl.cpp index 376245d540..3efda8f826 100644 --- a/src/server/pegasus_server_impl.cpp +++ b/src/server/pegasus_server_impl.cpp @@ -801,7 +801,7 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc) keys.reserve(request.keys.size()); std::vector<::dsn::blob> keys_holder; keys_holder.reserve(request.keys.size()); - for (auto &key : request.keys) { + for (const auto &key : request.keys) { ::dsn::blob raw_key; pegasus_generate_key(raw_key, key.hash_key, key.sort_key); keys.emplace_back(rocksdb::Slice(raw_key.data(), raw_key.length())); @@ -857,12 +857,12 @@ void pegasus_server_impl::on_batch_get(batch_get_rpc rpc) "rocksdb get failed for batch_get from {}: error = {}, key size = {}", replica_name(), rpc.remote_address().to_string(), - status.ToString().c_str(), + status.ToString(), request.keys.size()); } else { derror_replica("rocksdb get failed for batch_get from {}: error = {}", rpc.remote_address().to_string(), - status.ToString().c_str()); + status.ToString()); } error_occurred = true;