| 88 | |
| 89 | #ifdef ENABLE_CURL |
| 90 | void curl_thread_entry(result* res) { |
| 91 | net::cURL client; |
| 92 | StringStream buffer; |
| 93 | client.set_redirect(0); |
| 94 | std::string target = "http://" + FLAGS_ip + ":" + std::to_string(FLAGS_port); |
| 95 | for (uint64_t i = 0; i < FLAGS_count; i++) { |
| 96 | auto t_begin = GetSteadyTimeUs(); |
| 97 | buffer.clean(); |
| 98 | client.GET(target.c_str(), &buffer); |
| 99 | auto t_end = GetSteadyTimeUs(); |
| 100 | if (buffer.ptr != (int)FLAGS_body_size) { |
| 101 | LOG_ERROR(VALUE(buffer.ptr), VALUE(errno), VALUE(i), VALUE(FLAGS_body_size)); |
| 102 | res->failed = true; |
| 103 | } |
| 104 | res->sum_throuput += FLAGS_body_size; |
| 105 | res->sum_latency += t_end - t_begin; |
| 106 | res->cnt++; |
| 107 | } |
| 108 | } |
| 109 | void test_curl(result &res) { |
| 110 | res.t_begin = GetSteadyTimeUs(); |
| 111 | std::vector<photon::join_handle*> jhs; |
nothing calls this directly
no test coverage detected