MCPcopy Create free account
hub / github.com/acl-dev/acl / del

Function del

lib_acl_cpp/samples/mem_cache/main.cpp:97–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97static void del(const char* addr, int id, int num)
98{
99 acl::mem_cache client(addr);
100 acl::string key;
101 int i;
102
103 client.set_prefix(__key);
104
105 for (i = 0; i < num; i++)
106 {
107 key.format("key:%d:%d", id, i);
108 if (client.del(key.c_str()) == false)
109 break;
110 if (i <= 100)
111 printf("DEL: %s\n", key.c_str());
112 if (i % 10000 == 0)
113 {
114 char tmp[256];
115 snprintf(tmp, sizeof(tmp), "DEL, i: %d, num: %d", i, num);
116 ACL_METER_TIME(tmp);
117 }
118 }
119 printf("OVER: total: %d\n", i);
120}
121
122typedef struct
123{

Callers 6

runMethod · 0.85
runMethod · 0.85
delMethod · 0.85
delMethod · 0.85
fmt_delMethod · 0.85
del_keysMethod · 0.85

Calls 3

formatMethod · 0.45
delMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected