| 14 | } |
| 15 | |
| 16 | static void get(const char* addr, int id, int num) |
| 17 | { |
| 18 | acl::mem_cache client(addr); |
| 19 | acl::string buf, key; |
| 20 | int i; |
| 21 | |
| 22 | client.set_prefix(__key); |
| 23 | |
| 24 | for (i = 0; i < num; i++) |
| 25 | { |
| 26 | key.format("key:%d:%d", id, i); |
| 27 | if (client.get(key.c_str(), buf) == false) |
| 28 | break; |
| 29 | if (i <= 100) |
| 30 | printf("GET: %s, %s\n", key.c_str(), buf.c_str()); |
| 31 | if (i % 10000 == 0) |
| 32 | { |
| 33 | char tmp[256]; |
| 34 | snprintf(tmp, sizeof(tmp), "GET, i: %d, num: %d", i, num); |
| 35 | ACL_METER_TIME(tmp); |
| 36 | } |
| 37 | } |
| 38 | printf("OVER: total: %d\n", i); |
| 39 | } |
| 40 | |
| 41 | static void mod(const char* addr, int id, int num) |
| 42 | { |
no test coverage detected