| 92 | } |
| 93 | |
| 94 | static void handle_rpc(const char* addr, int max) |
| 95 | { |
| 96 | http_request rpc(addr); |
| 97 | |
| 98 | struct timeval begin; |
| 99 | gettimeofday(&begin, NULL); |
| 100 | |
| 101 | char buf[64]; |
| 102 | ACL_METER_TIME("begin run"); |
| 103 | for (int i = 0; i < max;) |
| 104 | { |
| 105 | if (handle_one(rpc, i >= 1 ? false : true) == false) |
| 106 | break; |
| 107 | if (++i % 1000 == 0) |
| 108 | { |
| 109 | snprintf(buf, sizeof(buf), "total count: %d, curr: %d", max, i); |
| 110 | ACL_METER_TIME(buf); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | struct timeval end; |
| 115 | gettimeofday(&end, NULL); |
| 116 | double n = util::stamp_sub(&end, &begin); |
| 117 | printf("total check: %d, spent: %0.2f ms, speed: %0.2f\r\n" |
| 118 | "total_build: %0.2f, total_parse: %0.2f, " |
| 119 | "total_request: %0.2f, total_reponse: %0.2f\r\n", |
| 120 | max, n, (max * 1000) /(n > 0 ? n : 1), |
| 121 | __build_spent, __parse_spent, |
| 122 | __request_spent, __response_spent); |
| 123 | } |
| 124 | |
| 125 | static void usage(const char* procname) |
| 126 | { |
no test coverage detected
searching dependent graphs…