Skip to content

Commit 0b0d218

Browse files
authored
feat: delete unused code about showtp #1823 (#1857)
1 parent f836165 commit 0b0d218

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

src/client/tablet_client.cc

-18
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ DECLARE_int32(request_max_retry);
3131
DECLARE_int32(request_timeout_ms);
3232
DECLARE_uint32(latest_ttl_max);
3333
DECLARE_uint32(absolute_ttl_max);
34-
DECLARE_bool(enable_show_tp);
3534

3635
namespace openmldb {
3736
namespace client {
@@ -767,18 +766,6 @@ bool TabletClient::GetTableFollower(uint32_t tid, uint32_t pid, uint64_t& offset
767766
return true;
768767
}
769768

770-
void TabletClient::ShowTp() {
771-
if (!FLAGS_enable_show_tp) {
772-
return;
773-
}
774-
std::sort(percentile_.begin(), percentile_.end());
775-
uint32_t size = percentile_.size();
776-
std::cout << "Percentile:99=" << percentile_[(uint32_t)(size * 0.99)]
777-
<< " ,95=" << percentile_[(uint32_t)(size * 0.95)] << " ,90=" << percentile_[(uint32_t)(size * 0.90)]
778-
<< " ,50=" << percentile_[(uint32_t)(size * 0.5)] << std::endl;
779-
percentile_.clear();
780-
}
781-
782769
bool TabletClient::Get(uint32_t tid, uint32_t pid, const std::string& pk, uint64_t time, std::string& value,
783770
uint64_t& ts, std::string& msg) {
784771
::openmldb::api::GetRequest request;
@@ -787,13 +774,8 @@ bool TabletClient::Get(uint32_t tid, uint32_t pid, const std::string& pk, uint64
787774
request.set_pid(pid);
788775
request.set_key(pk);
789776
request.set_ts(time);
790-
uint64_t consumed = ::baidu::common::timer::get_micros();
791777
bool ok =
792778
client_.SendRequest(&::openmldb::api::TabletServer_Stub::Get, &request, &response, FLAGS_request_timeout_ms, 1);
793-
if (FLAGS_enable_show_tp) {
794-
consumed = ::baidu::common::timer::get_micros() - consumed;
795-
percentile_.push_back(consumed);
796-
}
797779
if (response.has_msg()) {
798780
msg = response.msg();
799781
}

src/client/tablet_client.h

-3
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ class TabletClient : public Client {
210210
const std::string& idx_name, const std::string& pk, uint64_t ts,
211211
uint32_t limit, uint32_t& count); // NOLINT
212212

213-
void ShowTp();
214-
215213
bool SetMode(bool mode);
216214

217215
bool DeleteIndex(uint32_t tid, uint32_t pid, const std::string& idx_name, std::string* msg);
@@ -287,7 +285,6 @@ class TabletClient : public Client {
287285

288286
private:
289287
::openmldb::RpcClient<::openmldb::api::TabletServer_Stub> client_;
290-
std::vector<uint64_t> percentile_;
291288
};
292289

293290
} // namespace client

0 commit comments

Comments
 (0)