| 64 | } |
| 65 | |
| 66 | static void set(const char* addr, int id, int num) |
| 67 | { |
| 68 | acl::mem_cache client(addr); |
| 69 | acl::string buf, key; |
| 70 | int i; |
| 71 | |
| 72 | client.set_prefix(__key); |
| 73 | |
| 74 | for (i = 0; i < num; i++) |
| 75 | { |
| 76 | key.format("key:%d:%d", id, i); |
| 77 | buf.format("dat:%d, sp( ), tab(\t), eq(=);", i); |
| 78 | if (client.set(key.c_str(), buf, buf.length(), __timeout) == false) |
| 79 | { |
| 80 | printf("SET error: %s\n", client.last_serror()); |
| 81 | break; |
| 82 | } |
| 83 | if (i <= 100) |
| 84 | printf("SET: %s\n", key.c_str()); |
| 85 | if (i % 10000 == 0) |
| 86 | { |
| 87 | char tmp[256]; |
| 88 | snprintf(tmp, sizeof(tmp), "SET, i: %d, num: %d, timeout: %d", |
| 89 | i, num, (int) __timeout); |
| 90 | ACL_METER_TIME(tmp); |
| 91 | } |
| 92 | } |
| 93 | client.property_list(); |
| 94 | printf("OVER: total: %d, timeout: %d\n", i, (int) __timeout); |
| 95 | } |
| 96 | |
| 97 | static void del(const char* addr, int id, int num) |
| 98 | { |
no test coverage detected