Eviltuzki commented on issue #2297:
URL: https://github.com/apache/brpc/issues/2297#issuecomment-1617550040
> 这个量级时延可以看到差异。
>
> 具体是如何测试的?结果如何?
使用echo-c++的示例进行修改,client和server的option都加了use_rdma=true
client循环请求部分代码如下:
```
// Normally, you should not call a Channel directly, but instead
construct
// a stub Service wrapping it. stub can be shared by all threads as well.
example::EchoService_Stub stub(&channel);
// Send a request and wait for the response every 1 second.
for (size_t i = 0; i < 1000000; i++)
{
if(i%100000==0){
time_t current_time = time(NULL); // 获取当前的 Unix 时间戳
struct tm* local_time = localtime(¤t_time); // 将时间戳转换为本地时间
printf("当前时间:%d年%d月%d日 %d:%d:%d\n",
local_time->tm_year + 1900, local_time->tm_mon + 1,
local_time->tm_mday,
local_time->tm_hour, local_time->tm_min, local_time->tm_sec);
}
example::EchoRequest request;
example::EchoResponse response;
brpc::Controller cntl;
request.set_message("hello world");
// cntl.request_attachment().append(FLAGS_attachment);
// Because `done'(last parameter) is NULL, this function waits until
// the response comes back or error occurs(including timedout).
stub.Echo(&cntl, &request, &response, NULL);
if (!cntl.Failed()) {
LOG(WARNING) << cntl.ErrorText();
}
}
LOG(INFO) << "EchoClient is going to quit";
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]