Skip to content

Commit

Permalink
Update LZ4_LIBRARY in Cmake; Remove not used variables;
Browse files Browse the repository at this point in the history
  • Loading branch information
holmes1412 committed May 18, 2022
1 parent a0655e7 commit f12406a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
4 changes: 3 additions & 1 deletion benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ find_package(OpenSSL REQUIRED)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "")
if (WIN32)
find_package(Protobuf CONFIG REQUIRED)
find_library(LZ4_LIBRARY NAMES lz4)
find_package(Snappy CONFIG REQUIRED)
else ()
find_package(Protobuf REQUIRED)
endif ()
Expand Down Expand Up @@ -106,7 +108,7 @@ elseif (WIN32)
protobuf::libprotobuf
ZLIB::ZLIB
Snappy::snappy
LZ4::LZ4
${LZ4_LIBRARY}
)
else ()
set(SRPC_LIB
Expand Down
8 changes: 4 additions & 4 deletions benchmark/client_cdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void do_echo_pb(CLIENT *client, int idx)

if (++query_count % 100 > 0)
{
client->echo_pb(&req, [client, ns_st, &latency_list, &mutex](EmptyPBMsg *response, RPCContext *ctx) {
client->echo_pb(&req, [ns_st, &latency_list, &mutex](EmptyPBMsg *response, RPCContext *ctx) {
if (ctx->success())
{
//printf("%s\n", ctx->get_remote_ip().c_str());
Expand All @@ -65,7 +65,7 @@ static void do_echo_pb(CLIENT *client, int idx)
}
else
{
client->slow_pb(&req, [client, ns_st](EmptyPBMsg *response, RPCContext *ctx) {
client->slow_pb(&req, [](EmptyPBMsg *response, RPCContext *ctx) {
slow_count++;
if (!ctx->success())
printf("status[%d] error[%d] errmsg:%s\n", ctx->get_status_code(), ctx->get_error(), ctx->get_errmsg());
Expand Down Expand Up @@ -93,7 +93,7 @@ static void do_echo_thrift(CLIENT *client, int idx)

if (++query_count % 100 > 0)
{
client->echo_thrift(&req, [client, ns_st, &latency_list, &mutex](BenchmarkThrift::echo_thriftResponse *response, RPCContext *ctx) {
client->echo_thrift(&req, [ns_st, &latency_list, &mutex](BenchmarkThrift::echo_thriftResponse *response, RPCContext *ctx) {
if (ctx->success())
{
//printf("%s\n", ctx->get_remote_ip().c_str());
Expand All @@ -114,7 +114,7 @@ static void do_echo_thrift(CLIENT *client, int idx)
}
else
{
client->slow_thrift(&slow_req, [client, ns_st](BenchmarkThrift::slow_thriftResponse *response, RPCContext *ctx) {
client->slow_thrift(&slow_req, [](BenchmarkThrift::slow_thriftResponse *response, RPCContext *ctx) {
slow_count++;
if (!ctx->success())
printf("status[%d] error[%d] errmsg:%s\n", ctx->get_status_code(), ctx->get_error(), ctx->get_errmsg());
Expand Down
2 changes: 0 additions & 2 deletions src/module/rpc_filter_metrics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ RPCMetricsOTel::RPCMetricsOTel(const std::string& url,
redirect_max(redirect_max),
retry_max(retry_max),
policy(report_threshold, report_interval_msec),
report_status(false),
report_counts(0)
{
}
Expand All @@ -398,7 +397,6 @@ RPCMetricsOTel::RPCMetricsOTel(const std::string& url) :
redirect_max(OTLP_HTTP_REDIRECT_MAX),
retry_max(OTLP_HTTP_RETRY_MAX),
policy(RPC_REPORT_THREHOLD_DEFAULT, RPC_REPORT_INTERVAL_DEFAULT),
report_status(false),
report_counts(0)
{
}
Expand Down
1 change: 0 additions & 1 deletion src/module/rpc_filter_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ class RPCMetricsOTel : public RPCMetricsFilter
int retry_max;
Collector collector;
RPCFilterPolicy policy;
bool report_status;
size_t report_counts;
std::mutex mutex;
std::map<std::string, std::string> attributes;
Expand Down
2 changes: 1 addition & 1 deletion tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ elseif (WIN32)
protobuf::libprotobuf
ZLIB::ZLIB
Snappy::snappy
LZ4::LZ4
${LZ4_LIBRARY}
)
else ()
set(SRPC_LIB
Expand Down

0 comments on commit f12406a

Please sign in to comment.